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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I add another IF statement - EXCEL

Status
Not open for further replies.

edwardpestian

Technical User
Apr 28, 2006
47
US
I would like to know if I can add another IF statement to the following formula. For example IF cell H9 = "Day" then perform the function.

Thanks.

EP

=IF(Date=0,"",OFFSET(Data!$E$5,ROW(A1)+100,MATCH(G 8,Data!$F$3:$CT$3,0)))
 
Okay, so I've got the above formula below working as needed; but I need to add to it.

I need it to perform the same OFFSET function, except with a change to the range. I need it to calculate based off of (A1)+101 IF H8<>"Swing"


=IF(OR(Date=0,$H$8<>"Day"),"",OFFSET(Data!$E$5,ROW ($A$1)+101,MATCH($G$8,Data!$F$3:$CT$3,0)))

I'm stuck on this one for days...

Thanks in advance for any help or feedback.

EP
 
I think you are asking if you can ask another If within the "False" portion of the formula you already have written and working. The answer is Yes. I'm not going to try to get the actual formula correct, this is just to show how you would put in the 2nd IF. You will need to work out your own OFFSET stuff.

=IF(OR(Date=0,$H$8<>"Day"),"",IF([red]H8<>"Swing"[/red],[blue](A1)+101[/blue],[green]OFFSET(Data!$E$5,ROW ($A$1)+101,MATCH($G$8,Data!$F$3:$CT$3,0)[/green])))
[red]Second IF question[/red]
[blue]If 2nd IF is true[/blue]
[green]If 2nd IF is false[/green]

This syntax holds works for multiple imbeded IFs, but I don't know how deep you can go with multiple IFs.

HTH,
Vic
 
Got it working like this:

=IF($H$8="Day",OFFSET(Data!$E$5,ROW($A$1)+101,MATCH($G$8,Data!$F$3:$CT$3,0)),IF($H$8="Swing",OFFSET(Data!$E$5,ROW($A$1)+102,MATCH($G$8,Data!$F$3:$CT$3,0)),IF($H$8="Grave",OFFSET(Data!$E$5,ROW($A$1)+103,MATCH($G$8,Data!$F$3:$CT$3,0)))))

Thanks for the help.

EP
 
That looks excellent, and is very understandable in its structure.
Good job!
Vic
 
Since most of your formula is the same, you might consider putting a nested IF or VLOOKUP inside your OFFSET:
=OFFSET(Data!$E$5,ROW($A$101)+IF($H$8="Day",1,IF($H$8="Swing",2,3)),MATCH($G$8,Data!$F$3:$CT$3,0))
Brad
 
I ended up settling on this one:

=IF($H$8="","",OFFSET(Data!$E$5,MATCH($H$8,{"Day","Swing","Grave"},0)+101,MATCH($G$8,Data!$F$3:$CT$3,0)))

Thanks for all the help.

EP
 
VicRaunch said:
I don't know how deep you can go with multiple IFs

You can nest up to 7 deep, although you need to be very disciplined indeed to keep all your brackets on track!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top