ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can I add an IF statement (https://www.excelbanter.com/excel-worksheet-functions/87189-can-i-add-if-statement.html)

edwardpestian

Can I add an IF statement
 

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


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484


systemx

Can I add an IF statement
 

Try -

=IF(H9="Day",IF(Date=0,"",OFFSET(Data!$E$5,ROW(A1) +100,MATCH(G
8,Data!$F$3:$CT$3,0))),"What to do if H9 does not equal Day")

That should work.

You can 'nest' up to 7 IF statements in one formula - after that it can
get a little more complicated. :)

Regards,

Rob :)


--
systemx
------------------------------------------------------------------------
systemx's Profile: http://www.excelforum.com/member.php...o&userid=29254
View this thread: http://www.excelforum.com/showthread...hreadid=539484


[email protected]

Can I add an IF statement
 
"edwardpestian" wrote:
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.
[....]
=IF(Date=0,"",OFFSET(Data!$E$5,ROW(A1)+100,
MATCH(G8,Data!$F$3:$CT$3,0)))


The short answer is: yes. But your intended logic is not clear.
The following might what you really want:

=if(or(Date=0, H9!="Day"), "", offset(...))

In other words, compute offset(...) only if Date is non-zero __and__
H9 is "Day". Alternatively, the following might be what you want:

=if(and(Date=0, H9!="Day"), "", offset(...))

That is, compute offset(...) if Date is non-zero __or__ H9 is "Day".

macropod

Can I add an IF statement
 
Hi EP,

Try:
if either Date should < 0 or H9 should = "Day":
=IF(OR(Date=0,H9<"Day"),"",OFFSET(Data!$E$5,ROW(A 1)+100,MATCH(G8,Data!$F$3:
$CT$3,0)))
or, if both Date should < 0 and H9 should = "Day":
=IF(AND(Date=0,H9<"Day"),"",OFFSET(Data!$E$5,ROW( A1)+100,MATCH(G8,Data!$F$3
:$CT$3,0)))

Cheers

"edwardpestian"
wrote in message
news:edwardpestian.27dd5a_1146891001.7016@excelfor um-nospam.com...

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


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile:

http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484




edwardpestian

Can I add an IF statement
 

Ultimaly what I'm trying to do is perform this calaculation but add in
another criteria. For Example:

If G8=Date AND G9="Day", then perform the following function. G8 will
remain a constant; it will alws be a date, but H9 will Change.


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484


edwardpestian

Can I add an IF statement
 

I need all three sub criteria to perform the same function. Whatever
the date in G9 is, and the shift in H9 is, then perform the function to
look the data up.

THe function works properly when I have it pull data based on the date
(g9); but I cannot get it to work with the second critera.

Thannks All:EP

=IF(Date=0,"",OFFSET(Data!$E$5,ROW(A1)+100,MATCH(G 8,Data!$F$3:$CT$3,0)))


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484


edwardpestian

Can I add an IF statement
 

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


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484


edwardpestian

Can I add an IF statement
 

Okay All, I was able to get to work using the following:

=IF($H$8="Day",OFFSET(Data!$E$5,ROW($A$1)+101,MATC H($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)+10 3,MATCH($G$8,Data!$F$3:$CT$3,0)))))

Thanks for your help.

EP


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484


Biff

Can I add an IF statement
 
Hi!

Try this:

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

Biff

"edwardpestian"
wrote in message
news:edwardpestian.27dw4m_1146915601.6324@excelfor um-nospam.com...

Okay All, I was able to get to work using the following:

=IF($H$8="Day",OFFSET(Data!$E$5,ROW($A$1)+101,MATC H($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)+10 3,MATCH($G$8,Data!$F$3:$CT$3,0)))))

Thanks for your help.

EP


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile:
http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484




edwardpestian

Can I add an IF statement
 

Worked great Biff. And much more eloquent than my version.

Thanks.

EP


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484


Biff

Can I add an IF statement
 
You're welcome. Thanks for the feedback!

Biff

"edwardpestian"
wrote in message
news:edwardpestian.27ejqn_1146946202.945@excelforu m-nospam.com...

Worked great Biff. And much more eloquent than my version.

Thanks.

EP


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile:
http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539484





All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com