Excel "ISBLANK" function With "IF" function - excel

I have multiple Excel workbooks in which there are many columns. There will be a column in English and a column in Spanish. What I am trying to do is compare the two columns to see if the Spanish column does indeed have translated text from English. That's easy enough:
IF(A2=C2, "NOT TRANSLATED", "TRANSLATED")
However, there are hundreds of cells that simply do not have values in both the English and Spanish columns. So the formula I used above will say "Yes, these are technically the same value even though they're null, so no translation has been done". This is causing it to seem like there are far too many "NOT TRANSLATED" values than there actually are. This is what I tried:
IF(A2=C2, "NOT TRANSLATED", "TRANSLATED", IF(ISBLANK(A2)=TRUE, "NULL VALUE", "CHECK VALUE"))
That gives me an error though.
I am thinking that I need to have a function that first checks to see if the cell has a value to begin with. If it does, then the formula should proceed to check to see if the two cells have identical values or not. If either cell does not have a value, then it should return "NULL VALUE". Any ideas?

You're effectively giving the IF function 4 parameters with that second formula. IF accepts at least 1 mandatory parameter (the condition) and then 2 optional parameters (what to do if it returns TRUE or FALSE).
Instead you need to nest your IF conditions with something like:
IF(A2=C2, IF(ISBLANK(A2)=TRUE, "NULL VALUE", "CHECK VALUE"), "TRANSLATED")
Which checks to see if A2=C2, if it is then it checks to see if A2 is blank, if it is (and A2=C2 remember) then it returns "NULL VALUE", if it isn't (but A2 is still equal to C2) then it reurns "CHECK VALUE" and if A2 isn't equal to C2 then it returns "TRANSLATED".
Obviously you might want to tweak this for your problem.

Wooo!!! With a little help from you guys I got it. It looks like this:
=IF(AND(ISBLANK(A2)=TRUE; ISBLANK(B2)=TRUE); "NULL"; IF(OR(ISBLANK(A2)=TRUE; ISBLANK(B2)=TRUE); "NOT TRANSLATED"; IF(A2=B2; "NOT TRANSLATED"; "TRANSLATED")))
That one was a monster.

You might find this formula helpful, it will check for a null value in either column
{=IF(OR(A1:B1=""),"Null Value",IF(A1=B1,"Not Translated","Translated"))}
Leave out the curly braces and enter the function using Ctrl+Shift+Enter
You can drag that down for the following results
a a Not Translated
b c Translated
d Null Value
e Null Value
Null Value
f f Not Translated

Try:
=IF(OR(LEN(A2)=0,LEN(C2)=0),"IS NULL",IF(A2=C2, "NOT TRANSLATED", "TRANSLATED"))

Related

Excel Formulae Issues

A formula that takes logical inputs and outputs either true or a statement if all logical inputs are true.
Hey there I am trying to have a cell in excel display a text of either Valid or Invalid under a column marked Status
=AND(IF(D2<TODAY(),"Invalid","Valid"),(IF(F2<TODAY(),"Invalid","Valid"),(IF(H2<TODAY(),"Invalid","Valid"))))
However the above formula I entered is giving me a 'value within is a wrong data type'
With the famous #Value!.
Is there anyway anyone can point out where I went wrong?
Each element inside of AND() needs to be an expression that evaluates to either TRUE or FALSE. Your formula has a single IF() statement inside of AND() that returns a text.
Guessing at what you would like to achieve, try
=IF(AND(D2<TODAY(),F2<TODAY(),H2<TODAY()),"Invalid","Valid")
in words: If D2 is before today AND F2 is before today AND H2 is before today, then return the text "Invalid", otherwise return the text "Valid"

Excel formula to return value instead of TRUE or False

I am very newbie in excel, I wanted to make my formula to return matched value instead of TRUE/FALSE
=NOT(NOT(SUM(--NOT(ISERR(SEARCH($D$2:$D$21;$B2))))))
is there anyway this formula can be revised to return like for example: found word "wow" and return the word into the cell instead of TRUE/FALSE?
thank you
Use the =IF function.
=IF(condition; value if true; value if false)
condition is your condition to test. For example $A$1 < 5
value if true is a value returned if condition is true
value if false opposite to previous part, this is a value returned if condition is false.
Following formula will return a $A$1 cell value if less than 5 and too big literally if $A$1's value is bigger or equal to 5:
=IF($A$1<5; $A$1; "too big")
Just combine it with your condition.
You can use IF function:
=IF(logical_test, CONCAT("Found word", $YourWord), "Not found")
This will help You Remember the "Text" must be in " "
=IF(ISNUMBER(SEARCH(substring;"WOW")); "Yes"; "No")
The Value will be only Yes or No , You may change that
There are two cases and I'm not sure which one you need
(1) You have a word like WOW, and you want to find matches in a list of strings like BOWWOW
(2) You have a word like WOW, and you want to find matches for part of it in a list of substrings like OW
The easiest way to do the first one is to use MATCH with a wildcard
=INDEX($D$2:$D$21,MATCH("*"&B2&"*",$D$2:$D$21,0))
For the second one you would need to modify your formula a bit
=INDEX($D$2:$D$21,MATCH(0,(ISERROR(SEARCH($D$2:$D$21,$B$2))+($D$2:$D$21="")),0))
or
=INDEX($D$2:$D$21,MATCH(1,ISNUMBER(SEARCH($D$2:$D$21,$B$2))*($D$2:$D$21<>""),0))
the last two entered as array formulae using CtrlShiftEnter

excel: if error then return "n/a" but if cell blank return nothing

How can I change the formula below to handle for empty cells?
=IFERROR('[KPI.xls]Sheet1'!F192, "N/A")
It corrects returns "N/A" when theres an error but it returns a 0 when the cell is blank.
I found many threads on this issue but couldn't get any to work.
If you wanted it to return "BLANK" if it were blank, you can use an if statement.
=IF(ISBLANK('[KPI.xls]Sheet1'!F192),"BLANK",IFERROR('[KPI.xls]Sheet1'!F192,"N/A"))
You can substitute in "" or whatever you like for "BLANK".
If you want to return N/A for blanks then
IF(or(ISERROR('[KPI.xls]Sheet1'!F192),ISBLANK('[KPI.xls]Sheet1'!F192)), "N/A")
This answer depends on what you trying to return. If you are returning a text value that may be blank and want to avoid the 0 then append a zero-length string. The cell will not be truly blank (a cell with a formula never is); it will contain a zero-length string instead of a zero.
=IFERROR('[KPI.xls]Sheet1'!F192&"", "N/A")
'alternate that makes inserting formula via VBA a little easier
=IFERROR('[KPI.xls]Sheet1'!F192&TEXT(,), "N/A")
However, if you are trying to return a number then you have effectively converted your numerical value into text-that-looks-like-a-number and this is generally not a desired result.

calc/excel if find text in two cells and output text

This is probably too simple but I just can't find my way around it.
I have to cells
A1 B1
high ground low water
So I need a formula that states that if cell A1 contains "high ground" and cell B1 contains the word "water" output "OK" otherwise "no ok"
Thanks in advance
Next formula is working for me:
=if(AND(A2="high ground",(B2=SEARCH("water",B2,1))>0),"ok","not ok")
I'm supposing cell A2 contains high groud, and cell B2 contains low water.
In the if statement there are two conditions: if cell A2= High ground and if cell b2 contains water then Ok else not ok.
Hope it works for you!!
Sorry, next is the right one (whithout HALLAR, instead SEARCH):
please try next:
=IF(AND(A1="high ground",(B1=SEARCH("water",B1,1))>0),"ok","not ok"
For OpenOffice / LibreOffice Calc, the following function should work:
=IF(AND(A1 = "high ground";NOT(ISERROR(SEARCH("water";B1;1))));"OK";"not OK")
or split up on multiple lines with comments:
=IF( # First function: result will depend on condition
AND( # Condition: two sub-conditions have to be TRUE
A1 = "high ground"; # First subcondition: simple equality check
NOT( # Second subcondition
ISERROR( # Check if the embededded function (SEARCH()) returns an error
SEARCH("water";B1;1) # Search B1 for substring. Will throw an error if there's no match in B! for string "water"
)
)
);
"OK"; # Return value if condition is fulfilled;
"not OK" # return value if on of the sub-conditions isn't fulfilled.
)
The NOT(ISERROR(SEARCH("water";B1;1))) is a little bit complicated. Since the SEARCH() function (as well as the FIND() function) throws an error if there's no match, you will have to handle that error, else the complete formula will return an error instead of the string "not ok". For error handling, i put the SEARCH() function into an ISERROR() function, translating the result of SEARCH() into a boolean value (TRUE or FALSE). Since we want a TRUE result if the search finds a match, we have to "invert" the output of ISERROR() using the NOT() function.
Searching for a substring could also be done using regular expressions, but this would require enabling regular expressions in the Calc Program Options; the proposed solution using ISERROR(SEARCH()) should work independently of that config setting.
Try this:
=if(AND(A1="high ground",B1="*water*"),"OK","Not OK")
Sorry my answer before included a wildcard within an If statement and for some reason excel doesn't recognise them.
I have tested this one and it should work for you:
=IF(AND(A1="high ground",ISNUMBER(SEARCH("water",B1))),"OK","Not OK")

IF ELSE in excel -- check if a cell is null/empty

I am not programming in VBA. This is a simple excel spreadsheet. Essentially, I have a formula the finds the lowest price in a range of cells and returns its respective column title. It works fine. However, some ranges do not have any values at all. So, the cell that populates with the column header displays #N/A in this case.
What I need to do is check whether or not this happens. If the result is #N/A, I want the cell to show "No Values to Reference." I was thinking something along the lines of:
=IF(CELL != NULL, Display_Header, ELSE "No Bids to Reference")
OR
=IF(CELL = NULL, No Bids to Reference", ELSE Display_Header)
I have tried both NULL and #N/A but I am not sure how Excel handles these situations. That is, how Excel handles #N/A returns.
IF(INDEX($D$1:$M$1,MATCH(MIN(D3:M3),D3:M3,0))= "#N/A","No Bids To Reference", INDEX($D$1:$M$1,MATCH(MIN(D3:M3),D3:M3,0)))
Since you have only one calculation here, you can simply use an IFERROR:
=IFERROR(INDEX($D$1:$M$1,MATCH(MIN(D3:M3),D3:M3,0)),"No Bids To Reference")
The IFERROR checks whether the expression evaluates to an error (it can be #N/A, #VALUE! or #REF!). If true, evaluate the next expression, otherwise return the first expression.
I would CTL+G, Special, and replace the values of all cells with formula errors.

Resources