Excel Nested IF AND formula - excel

I can't tell why I'm getting an error with the below formula:
=IF(AND(AL=AM, AK=TRUE), "Unchanged, " ", IF(AND(AL>AM, AK=TRUE), "Downgrade", " ", IF(AND(AL<AM, AK=TRUE), "Upgrade, " ")))
Columns AL and AM contain values 0-4. Column AK contains True/false. If the conditions are met I want to insert the text string. If they are not met, I want to insert the single space to leave the cell blank.
Thank you!

You need to put the nested IFs in the False of the previous:
=IF(AND(AL1=AM1, AK1), "Unchanged", IF(AND(AL1>AM1, AK1), "Downgrade", IF(AND(AL1<AM1, AK), "Upgrade", " ")))
Another method with out the AND():
IF(AK1,IF(L1=AM1,"Unchanged",IF(L1>AM1,"Downgrade",IF(L1<AM1,"Upgrade",""))),"")

You don't need the " " after each of the text strings. The formula wasn't working because you were trying to define 4 parameters in each if statement. removing the ," " should fix this.
=IF(AND(AL=AM, AK=TRUE), "Unchanged, IF(AND(AL>AM, AK=TRUE), "Downgrade", IF(AND(AL<AM, AK=TRUE), "Upgrade, " ")))

Related

Hyperlink formula for sending email in outlook

I am trying to automate a task that's repetitive but I'm aware that hyperlink doens't allow me to copy and paste a range of cells so I'm doing the tedious task of trying to format it correctly but it seems the amount of blank cells in a string is creating too much of a issue. Is there a way to edit it to where I don't have to have so much white space to create the format I need?
I should mention, when I evaluate the formula, it returns everything correctly but then it gets to "Send Email" and I get a #VALUE error.
The goal is to format it into 4 columns and space it out.
(The only reason why I'm using a formula instead of VBA is because the higher-ups do not want VBA due to how sensitive the spreadsheet is.)
=HYPERLINK("mailto:" & F16 & "?subject=Testing" &"&body=" & " Product " & " Agvance Blend Ticket " & " Invoice/ Transfers # " & " Qty " & "%0A"
& CONCATENATE(" ", C5," ",E5," ",F5, " ", G5) & "%0A"
& CONCATENATE(" ", C6," ",E6," ",F6, " ", G6),"Send Email")
If whitespace is the problem, then don't use it; use the Outlook tab character instead, e.g.
=HYPERLINK("mailto:" &F16&"?subject=Testing&body=%09Product%09%09Agvance Blend Ticket%09%09Invoice/ Transfers #%09%09Qty%0A"
&CONCATENATE("%09",C5,"%09%09",E5,"%09%09%09%09",F5,"%09%09%09%09",G5,"%0A")
&CONCATENATE("%09",C6,"%09%09",E6,"%09%09%09%09",F6,"%09%09%09%09",G6),"Send Email")
sample draft email

Hi "Mr." Brad Pitt! in column

Column A - first name list
Column B - last name list
Column C - salutation list
I want in column D: HI "salutation" + first name + last name!
I try ="Hi &C1&" "&A1&" "&B1&"!" -> result Hi Mr. Brad Pitt!
But I want the result Hi "Mr." Brad Pitt!
You can use two double quotes where you want each double quote to be, in order to escape it.
="Hi """&C1&""" "&A1&" "&B1&"!"
you can use 2 double quotes to get a double quote in your text.
Try this instead: ="Hi """&C1&""" "&A1&" "&B1&"!"
Try below formula-
="Hi " & CHAR(34) & C1 & CHAR(34) & " " & A1 &" "&B1&"!"

Ms Excel IF ISNUMBER SEARCH for multiple text using AND or OR operator

This is my excel data
As you can see in B2, this formula only search for the first text it found and will ignore the rest.
What I'm trying to accomplish is if 2 or more different texts are found like B2, is it possible to print another message ... let say Apple & Banana found
This is my original excel formula for your reference:
=IF(ISNUMBER(SEARCH("apple",A2)),"Apple",
IF(ISNUMBER(SEARCH("banana",A2)),"Banana",
IF(ISNUMBER(SEARCH("cher",A2)),"Cherries",
"Other")))
I have tried and tried and thought hmmm why don't I simply add a SUBSTITUTE function...and it worked ;o)
Just in case there is someone out there looking for this:
=SUBSTITUTE(TRIM(CONCATENATE(IF(ISNUMBER(SEARCH("apple",A2)),"Apple "," "),
IF(ISNUMBER(SEARCH("banana",A2)),"Banana "," "),
IF(ISNUMBER(SEARCH("cher",A2)),"Cherries "," "),
IF(SUM((ISNUMBER(SEARCH({"apple","banana","cher"},A2,1)))+0)=0,"Other "," "))),"Apple Banana","Both")
See if following formula tweak helps you:
=TRIM(CONCATENATE(IF(ISNUMBER(SEARCH("apple",A2)),"Apple "," "),
IF(ISNUMBER(SEARCH("banana",A2)),"Banana "," "),
IF(ISNUMBER(SEARCH("cher",A2)),"Cherries "," "),
IF(SUM((ISNUMBER(SEARCH({"apple","banana","cher"},A2,1)))+0)=0,"Other "," ")))&" found"
Here is my proposal :
You create a Table with your KeyWord and Result in two columns
(columns K for KeyWord and L for Result).
You change your formula like this
=IF(ISNUMBER(SEARCH(K2,A2)),L2, IF(ISNUMBER(SEARCH(K3,A2)),L3, IF(ISNUMBER(SEARCH(K4,A2)),L4, "Other")))
After that, is more easy to add new KeyWord, to change the order if you want to prioritize a KeyWord more than an other.
You can't use more than 63 KeyWords, but you can create a second formula from 64 to 126.

Find key word exactly from a text field in Excel

I have a formula below:
=ISNUMBER(SEARCH("Perso",$A2))
I want to it return True for the field that exactly contains my key word "Perso"
However, from the image you can see that both rows return True, because the word "person" also contains "perso".
Can anyone provide some suggestions on how can I achieve my goal in Excel.
Include the deliminating space:
=ISNUMBER(SEARCH(" Perso "," " & $A2 & " "))

Excel search function - match case

I'm trying to find if cells have specific string or not. This is how I do it right now:
=IF(ISNUMBER(SEARCH("AAA";L2)); "yes"; "no")
If a cell has "AAA", I write to another cell yes, if not, I write no...
The problem is that it also gets true answer for AAA1 or AAA1234 for an example, how can I return true statement only for AAA?
If there are trailing numbers/charcters in my string, I want to reutrn no, but the cell itself might be longer... for and example "AAA BVC BFD2" etc. Then I want to return true. False if for an example: "AAA1 BVC BFD2"
As I mentioned in comments, you can use this one:
=IF(ISNUMBER(SEARCH(" AAA ";" " & L2 & " ")); "yes"; "no")
How it works:
suppose you have a string "AAA BVC BFD2" in cell L2.
" " & L2 & " " part modifies this string to " AAA BVC BFD2 " (note, there're additional spaces in the end and in the beggining)
now, we're able to search " AAA " (with spaces) in modified string " " & L2 & " ".
I'm clearly missing something as it seems to me that you could do this with something as simple as
=IF(LEFT(A1,4)="AAA ","yes","no")
I don't think the question is particularly clear, if I'm being honest...

Resources