Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Im trying to do an IF OR statement, but I have something wrong. I currently
have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What Im trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=IF($P3480, AB348-P348),IF($U3480,P348-U348,""))
This is read as: If P is greater than zero, return AB minus P Else if U is great than 0, return P minus U But is you want "to subtract AB from P" - to quote your message- then use =IF($P3480, P348-AB348),IF($U3480,P348-U348,"")) You also use the phrase "if column P is filled ", so maybe P could have a negative value or even a zero value and still be considered "filled", if so =IF($P348< "", P348-AB348),IF($U348< "",P348-U348,"")) This reads: If P is not empty, then ,,,,, else if U is not empty Please come back if clarifications are needed best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Cindi" wrote in message ... I'm trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What I'm trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try it this way:
=IF($P3480,P348-AB348,IF($U3480,P348-U348,"")) This, as requested "subtracts AB from P". If this isn't really what you want, then try: =IF($P3480,AB348-P348,IF($U3480,P348-U348,"")) BTW, plus signs at the beginning of formulae are superfluous. Regards, Fred. "Cindi" wrote in message ... Im trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What Im trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks.
-- JustLearning "Bernard Liengme" wrote: =IF($P3480, AB348-P348),IF($U3480,P348-U348,"")) This is read as: If P is greater than zero, return AB minus P Else if U is great than 0, return P minus U But is you want "to subtract AB from P" - to quote your message- then use =IF($P3480, P348-AB348),IF($U3480,P348-U348,"")) You also use the phrase "if column P is filled ", so maybe P could have a negative value or even a zero value and still be considered "filled", if so =IF($P348< "", P348-AB348),IF($U348< "",P348-U348,"")) This reads: If P is not empty, then ,,,,, else if U is not empty Please come back if clarifications are needed best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Cindi" wrote in message ... I'm trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What I'm trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks. I forgot something. Sometimes column P is N/A. How do I add this
to the formula to make column AC N/A if this is true for column P? -- JustLearning "Fred Smith" wrote: Try it this way: =IF($P3480,P348-AB348,IF($U3480,P348-U348,"")) This, as requested "subtracts AB from P". If this isn't really what you want, then try: =IF($P3480,AB348-P348,IF($U3480,P348-U348,"")) BTW, plus signs at the beginning of formulae are superfluous. Regards, Fred. "Cindi" wrote in message ... Im trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What Im trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=if(ISNA($P348), NA(), IF($P3480,P348-AB348,IF($U3480,P348-U348,"")))
Note three closing ) at end -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Cindi" wrote in message ... Thanks. I forgot something. Sometimes column P is N/A. How do I add this to the formula to make column AC N/A if this is true for column P? -- JustLearning "Fred Smith" wrote: Try it this way: =IF($P3480,P348-AB348,IF($U3480,P348-U348,"")) This, as requested "subtracts AB from P". If this isn't really what you want, then try: =IF($P3480,AB348-P348,IF($U3480,P348-U348,"")) BTW, plus signs at the beginning of formulae are superfluous. Regards, Fred. "Cindi" wrote in message ... I'm trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What I'm trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In my opinion, the best way to handle N/A's is not to have them in the first
place. I would fix the formula that currently generates the N/A. Regards, Fred. "Fred Smith" wrote in message ... Try it this way: =IF($P3480,P348-AB348,IF($U3480,P348-U348,"")) This, as requested "subtracts AB from P". If this isn't really what you want, then try: =IF($P3480,AB348-P348,IF($U3480,P348-U348,"")) BTW, plus signs at the beginning of formulae are superfluous. Regards, Fred. "Cindi" wrote in message ... Im trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What Im trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you. You've been very helpful.
-- JustLearning "Bernard Liengme" wrote: =if(ISNA($P348), NA(), IF($P3480,P348-AB348,IF($U3480,P348-U348,""))) Note three closing ) at end -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Cindi" wrote in message ... Thanks. I forgot something. Sometimes column P is N/A. How do I add this to the formula to make column AC N/A if this is true for column P? -- JustLearning "Fred Smith" wrote: Try it this way: =IF($P3480,P348-AB348,IF($U3480,P348-U348,"")) This, as requested "subtracts AB from P". If this isn't really what you want, then try: =IF($P3480,AB348-P348,IF($U3480,P348-U348,"")) BTW, plus signs at the beginning of formulae are superfluous. Regards, Fred. "Cindi" wrote in message ... I'm trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What I'm trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you for the help. Sorry can't get rid of the N/A, it's required for a
blank field. -- JustLearning "Fred Smith" wrote: In my opinion, the best way to handle N/A's is not to have them in the first place. I would fix the formula that currently generates the N/A. Regards, Fred. "Fred Smith" wrote in message ... Try it this way: =IF($P3480,P348-AB348,IF($U3480,P348-U348,"")) This, as requested "subtracts AB from P". If this isn't really what you want, then try: =IF($P3480,AB348-P348,IF($U3480,P348-U348,"")) BTW, plus signs at the beginning of formulae are superfluous. Regards, Fred. "Cindi" wrote in message ... Im trying to do an IF OR statement, but I have something wrong. I currently have: Columns P, U and AB are formatted as a custom date. Column AC (destination column) is a whole number. =IF(OR($P3480,+AB348-P348),"",IF($U3480,+P348-U348,"")) What Im trying to accomplish is, if column P is filled in then subtract AB from P, but if U is filled, then subtract U from P, otherwise leave column AC blank. Can someone please help me? -- JustLearning |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUMIF statement with AND statement | Excel Discussion (Misc queries) | |||
Can an If statement answer an If statement? | Excel Discussion (Misc queries) | |||
appending and IF statement to an existing IF statement | Excel Worksheet Functions | |||
If statement and Isblank statement | Excel Worksheet Functions | |||
Help please, IF statement/SUMIF statement | Excel Worksheet Functions |