How to compare two formula (calculated) cells in Google Sheets - if-statement

I am trying to compare two formula (calculated) cells in Google Sheets but I am getting: Error - Formula parse error.
The two cells are:
=IF(OR(ISBLANK(E5), ISBLANK(H5)),"", E5-H5)
=IF(OR(ISBLANK(E5), ISBLANK(J5)),"", E5-J5)
And the cell I am trying to compare them in is:
=IF(K5==K4, "yes", "no")
An help on how to compare these cells?

use just one = sign:
=IF(K5=K4, "yes", "no")

Tested your scenario and found out that if you have values on E5 and H5, then it works as long as it is numeric. Do something like
=IF(AND(ISNUMBER(E5), ISNUMBER(J5)), E5-J5, "")
So, if both cells are numbers, we subtract them, otherwise we have an empty value.

Related

Array Formula in just one cell

I have a formula that do almost what I need. I'm trying to get a list of values with a condition depending about one value, is objetive 1 is equal or over to 80 show me the list of objetives equal or over 80. My formula is this one:
=ARRAYFORMULA(IF(('Product Prioritization Matrix'!C7:C >= 80), 'Product Prioritization Matrix'!B7:B,""))
My problem comes when I try to put this in just one cell in the last image will show what I need visualy.
The next images will show the sheets:
My formula
Expected result
I think a JOIN(... , FILTER( structure will work for this:
=JOIN(", ",FILTER(Sheet1!B:B,Sheet1!C:C>=80))

Google sheets IF stops working correctly when wrapped in ARRAYFORMULA

I want this formula to calculate a date based on input from two other dates. I first wrote it for a single cell and it gives the expected results but when I try to use ARRAYFORMULA it returns the wrong results.
I first use two if statements specifycing what should happen if either one of the inputs is missing. Then the final if statement calculates the date if both are present based on two conditions. This seems to work perfectly if I write the formula for one cell and drag it down.
=IF( (LEN(G19)=0);(U19+456);(IF((LEN(U19)=0) ;(G19);(IF((AND((G19<(U19+456));(G19>(U19+273)) ));(G19);(U19+456))))))
However, when I want to use arrayformula to apply it to the entire column, it always returns the value_if_false if neither cell is empty, regardless of whether the conditions in the if statement are actually met or not. I am specifically talking about the last part of the formula that calculates the date if both input values are present, it always returns the result of U19:U+456 even when the result should be G19:G. Here is how I tried to write the ARRAYFORMULA:
={"Date deadline";ARRAYFORMULA(IF((LEN(G19:G400)=0);(U19:U400+456);(IF((LEN(U19:U400)=0);
(G19:G400);(IF((AND((G19:G400<(U19:U400+456));(G19:G400>(U19:U400+273)) ));(G19:G400);(U19:U400+456)))))))}
I am a complete beginner who only learned to write formulas two weeks ago, so any help or tips would be greatly appreciated!
AND and OR are not compatible with ARRAYFORMULA
Replace them by * or +
Try
={"Date deadline";ARRAYFORMULA(
IF((LEN(G19:G400)=0),(U19:U400+456),
(IF((LEN(U19:U400)=0), (G19:G400),
(IF((((G19:G400<(U19:U400+456))*(G19:G400>(U19:U400+273)) )),(G19:G400),
(U19:U400+456)))
))
)
)}
Keep in mind you cannot use AND, OR operators in an arrayformula, so you must find an alternative method such as multiplying the values together and checking them for 0 or 1 (true*true=1)
I am gathering based on your formula's and work that you want to have the following:
If G19 is blank show U19 + 456
If U19 is blank show G19
If G19 is less than U19 + 456 but greater than U19 + 273 show G19
Otherwise show U19 + 456
I'm not too sure what you want to happen when both columns G and U are empty. Based on your current formula you are returning an empty cell + 456... but with this formula it returns an empty cell rather than Column U + 456
Formula
={"Date deadline";ARRAYFORMULA(TO_DATE(ARRAYFORMULA(IFS((($G19:$G400="")*($U19:$U400=""))>0,"",$G19:$G400="",$U19:$U400+456,$U19:$U400="",$G19:$G400,(($G19:$G400<$U19:$U400+456)*($G19:$G400>$U19:$U400+273))>0,$G19:$G400,TRUE,$U19:$U400+456))))}

If text match in range conditonal formula Google Sheets error

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"))

Google Sheets: same values don't recognized as same

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")

Highlighting a whole row if number of blank cells in the row = a certain number

I'm trying to highlight a row if the number of blank cells between say, C1 and E1 = 3
and then copy this down for every row.
I've tried using:
=IF(COUNTBLANK($C1:$E1)=3)
But it's not working, can anybody help?
Under conditional formatting, your formula should be the following based on what you've given. The reason is conditional format is trying to see the result as TRUE or False. The IF statement is trying to tell the computer what to do when it's TRUE or FALSE.
COUNTBLANK($C1:$E1)=3
if you want to use IF you will need to do it like this:
=IF(COUNTBLANK($C1:$E1)=3, 1)