Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Excel "Nested If" Gurus

Status
Not open for further replies.

TommyP

MIS
Apr 16, 2001
30
US
I am not quite sure if this can be done, but here goes. I have two columns F and G that I use to compare cell data.

Example formula in Column F =B1=D1. Column G would have formula =C1=E1.

In column A I am trying to figure out a formula to do display the words "ADD", "Update" or "Do Nothing".

Here is the logic.
If F1 = False And G1 = False - "Add"
If F1 = True And G1 = False - "Update"
If F1 = True And G1 = True - "Do Nothing"


TIA.
TOMMY P




 


=IF(AND(F1="False",G1="False"),"Add",IF(AND(F1="True",G1="False),"Update","Do Nothing"))

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
First question: what if If F1 = False And G1 = True ? I assume that should also be "Update".

Don't use the helper cells. You can just include the formulas in F & G in the formula in A.

The logic will look like this:
=IF(
[tab]AND(B1<>D1,C1<>E1),
"Add",
IF(
[tab]OR(
[tab][tab]AND(B1=D1,C1<>E1),
[tab][tab]AND(B1<>D1,C1=E1)),
"Update",
IF(
[tab]AND(B1=D1,C1=E1),
"Do Nothing")))

Or, as viewed normally:
[COLOR=blue white]
=IF(AND(B1<>D1, C1<>E1), "Add", IF(OR(AND(B1=D1, C1<>E1), AND(B1<>D1, C1=E1)), "Update", IF(AND(B1=D1, C1=E1),"Do Nothing")))
[/color]

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Just another option, assuming that the combinations listed are the only ones possible.

=LOOKUP(F1+G1+1,{1,"Add";2,"Update";3,"Do Nothing"})

Regards
Ken..........

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Also,

=CHOOSE(F1+G1+1,"Add","Update","Do Nothing")

Member- AAAA Association Against Acronym Abusers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top