ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula (https://www.excelbanter.com/excel-discussion-misc-queries/55947-formula.html)

[email protected]

Formula
 
Hi all,

I am using the following formula in a Excel 2003.

=IF((F12="Maternity leave"),C12/5*G12,IF((F12="Jury
Service"),C12/5*G12,IF((F12="Paternity
Leave"),C12/5*G12,IF((F12="Family Leave"),C12/5*G12,IF((F12="Special
Leave"),C12/5*G12,IF((F12="Unauthorised
Absence"),C12/5*G12,IF((F12="Compassionate
Leave"),C12/5*G12,IF((F12="Annual leave"),C12/5*G12))))))))

I'm trying to state that if F12 is one of the values listed then
display the result of the calculation C12/5*G12.

This is working.

Where would I add something to this to display text if F12 does not
equal any of the values listed? At the moment it displays FALSE, I just
want it blank.

Is there another way to get the desired result other than an IF
statement? It's ery long and in the future may be even longer. Would a
CASE statement work?

Thanks.

Gary.


Roger Govier

Formula
 
Hi Gary

Try
=IF(OR(F12="Maternity leave",F12="Jury Service", .....,F12="Annual
Leave"),C12/5*G12,"")

(sorry, I got bored with the typing, you can fill in the rest<bg, or
shorten the entries to ML, JS etc.)

Regards

Roger Govier


wrote:
Hi all,

I am using the following formula in a Excel 2003.

=IF((F12="Maternity leave"),C12/5*G12,IF((F12="Jury
Service"),C12/5*G12,IF((F12="Paternity
Leave"),C12/5*G12,IF((F12="Family Leave"),C12/5*G12,IF((F12="Special
Leave"),C12/5*G12,IF((F12="Unauthorised
Absence"),C12/5*G12,IF((F12="Compassionate
Leave"),C12/5*G12,IF((F12="Annual leave"),C12/5*G12))))))))

I'm trying to state that if F12 is one of the values listed then
display the result of the calculation C12/5*G12.

This is working.

Where would I add something to this to display text if F12 does not
equal any of the values listed? At the moment it displays FALSE, I just
want it blank.

Is there another way to get the desired result other than an IF
statement? It's ery long and in the future may be even longer. Would a
CASE statement work?

Thanks.

Gary.


[email protected]

Formula
 
Thanks a lot Roger! Much appreciated.


Roger Govier wrote:
Hi Gary

Try
=IF(OR(F12="Maternity leave",F12="Jury Service", .....,F12="Annual
Leave"),C12/5*G12,"")

(sorry, I got bored with the typing, you can fill in the rest<bg, or
shorten the entries to ML, JS etc.)

Regards

Roger Govier


wrote:
Hi all,

I am using the following formula in a Excel 2003.

=IF((F12="Maternity leave"),C12/5*G12,IF((F12="Jury
Service"),C12/5*G12,IF((F12="Paternity
Leave"),C12/5*G12,IF((F12="Family Leave"),C12/5*G12,IF((F12="Special
Leave"),C12/5*G12,IF((F12="Unauthorised
Absence"),C12/5*G12,IF((F12="Compassionate
Leave"),C12/5*G12,IF((F12="Annual leave"),C12/5*G12))))))))

I'm trying to state that if F12 is one of the values listed then
display the result of the calculation C12/5*G12.

This is working.

Where would I add something to this to display text if F12 does not
equal any of the values listed? At the moment it displays FALSE, I just
want it blank.

Is there another way to get the desired result other than an IF
statement? It's ery long and in the future may be even longer. Would a
CASE statement work?

Thanks.

Gary.




All times are GMT +1. The time now is 01:16 AM.

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