Can't figure our why the formula is wrong, it outputs an #error
=IF(AND(($E6<=O$5);($F6>=O$5));"A";"")OR(IF(AND(($E6<=O$5);($h6>=O$5));"X";""))
try:
=IF(($E6<=O$5)*($F6>=O$5); "A";
IF(($E6<=O$5)*($H6>=O$5); "X"; ))
Related
I'm trying to get a match in a range of text in Google Sheets basically I'm using this formula:
=IF(REGEXMATCH(H2:M2, "Hi"), "Yes", "No")
But I'm getting an error that is:
You are referencing an array in a function that is not designed to take arrays as input so you need to enable them.
Try:
=ArrayFormula(IF(REGEXMATCH(H2:M2, "Hi"), "Yes", "No"))
I'm trying to do this: =IF(("Hi"=H2:L2),"Approve","No qualify") =IF(("Here"= H2:L2),"Approve","No qualify")
Assuming E1:E2 is the list of values to check against A1:C1, you can try:
=ArrayFormula(if(countif(E1:E2,A1:C1),"Approved","Not qualified"))
What I want to do:
Check if 4 of my cells are blank or not
If all of them are not blank, then its okay, else display nothing ("")
I want it to be auto dragged down
What I have tried
=arrayformula(if(AND(not(A1:D=""),not(B1:B=""),not(C1:C=""),not(D1:D="")),"ok",""))
Result
Although the statements of AND is true, it displays nothing ""
What can be the issue in the formula?
When we use AND() , OR() it won't work with array, I'm not sure why
But we can count true/false as a number of 1 = true and 0 = false
=arrayformula(if(not(A1:A="")+not(B1:B="")+not(C1:C="")+not(D1:D="")>3,"ok",))
AND is not supported in AF.
use in row 1:
=ARRAYFORMULA(IF((A1:A<>"")*(B1:B<>"")*(C1:C<>"")*(D1:D<>""); "ok"; ))
I'm trying to build an IF formula, where I compare two dates, but my formula means same dates would be different.
So, I have in A2 a date, like 2019-11-04.
In B2 I have a date like 201945.
In A3 I check the week number with =isoweeknum(A2) and get 45.
In B3 I check the week number with =MID(B2; 5; 2) and get 45 too.
Then i try to compare them with =IF(((isoweeknum(A2))=(MID(B2;5;2))); "OK"; "different numbers") - but get different numbers.
On trying to write the formula as =IF(a3=b3; "OK"; "different numbers") I get different numbers too.
Why Sheets treat it as different? How should I write the formula so, that these same values are recognized as same?
MID auto-converts stuff to string (Plain text) so try:
=IF(ISOWEEKNUM(A2)=MID(B2; 5; 2)*1; "OK"; "different numbers")
I have a column in data frame which ex df:
A
0 Good to 1. Good communication EI : tathagata.kar#ae.com
1 SAP ECC Project System EI: ram.vaddadi#ae.com
2 EI : ravikumar.swarna Role:SSE Minimum Skill
I have a list of of strings
ls=['tathagata.kar#ae.com','a.kar#ae.com']
Now if i want to filter out
for i in range(len(ls)):
df1=df[df['A'].str.contains(ls[i])
if len(df1.columns!=0):
print ls[i]
I get the output
tathagata.kar#ae.com
a.kar#ae.com
But I need only tathagata.kar#ae.com
How Can It be achieved?
As you can see I've tried str.contains But I need something for extact match
You could simply use ==
string_a == string_b
It should return True if the two strings are equal. But this does not solve your issue.
Edit 2: You should use len(df1.index) instead of len(df1.columns). Indeed, len(df1.columns) will give you the number of columns, and not the number of rows.
Edit 3: After reading your second post, I've understood your problem. The solution you propose could lead to some errors.
For instance, if you have:
ls=['tathagata.kar#ae.com','a.kar#ae.com', 'tathagata.kar#ae.co']
the first and the third element will match str.contains(r'(?:\s|^|Ei:|EI:|EI-)'+ls[i])
And this is an unwanted behaviour.
You could add a check on the end of the string: str.contains(r'(?:\s|^|Ei:|EI:|EI-)'+ls[i]+r'(?:\s|$)')
Like this:
for i in range(len(ls)):
df1 = df[df['A'].str.contains(r'(?:\s|^|Ei:|EI:|EI-)'+ls[i]+r'(?:\s|$)')]
if len(df1.index != 0):
print (ls[i])
(Remove parenthesis in the "print" if you use python 2.7)
Thanks for the help. But seems like I found a solution that is working as of now.
Must use str.contains(r'(?:\s|^|Ei:|EI:|EI-)'+ls[i])
This seems to solve the problem.
Although thanks to #IsaacDj for his help.
Why not just use:
df1 = df[df['A'].[str.match][1](ls[i])
It's the equivalent of regex match.
I am trying to get the following statement to work.
=IF(N3=100, (=concatenate("Text",A3;)), "Result").
Keep on coming with an error.
Any ideas please?
Do this instead:
=IF(N3=100, concatenate("Text",A3), "Result")
you can simply do it like:
=IF(N3=100, "Text "&A3), "Result")