ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   What's wrong with this IF? (https://www.excelbanter.com/excel-worksheet-functions/446679-whats-wrong-if.html)

Jay07

What's wrong with this IF?
 
=IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine Works",IF(H2=PM03,"Pre Planned Maintenance")))

Column H can only contain either of PM01, PM02 or PM03. I want Column I to show the above values for each option.

It works for both PM01 & PM02 but I'm just getting #NAME? for PM03.



Thanks in advance.

Jay07

Quote:

Originally Posted by Jay07 (Post 1604023)
=IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine Works",IF(H2=PM03,"Pre Planned Maintenance")))

Column H can only contain either of PM01, PM02 or PM03. I want Column I to show the above values for each option.

It works for both PM01 & PM02 but I'm just getting #NAME? for PM03.



Thanks in advance.

Never mind. Realised my mistake. No "" for PM03.

Rookie mistake!

Spencer101

Quote:

Originally Posted by Jay07 (Post 1604024)
Never mind. Realised my mistake. No "" for PM03.

Rookie mistake!

With only the three possible values, you could have shortened the formula to...

=IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine Works","Pre Planned Maintenance"))
:)

Jay07

Quote:

Originally Posted by Spencer101 (Post 1604026)
With only the three possible values, you could have shortened the formula to...

=IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine Works","Pre Planned Maintenance"))
:)

Yeah I know that sort of thing is possible but just didn't know how.

Now I do.

Cheers

Vacuum Sealed

What's wrong with this IF?
 
On 26/07/2012 9:01 PM, Jay07 wrote:
=IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine
Works",IF(H2=PM03,"Pre Planned Maintenance")))

Column H can only contain either of PM01, PM02 or PM03. I want Column I
to show the above values for each option.

It works for both PM01 & PM02 but I'm just getting #NAME? for PM03.



Thanks in advance.




Hi

Try this

=IF(H2="","",IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine
Works","Pre Planned Maintenance")))

This takes into account a 4th condition being that H2 is blank.

HTH
Mick.

Vacuum Sealed

What's wrong with this IF?
 
On 27/07/2012 12:51 AM, Vacuum Sealed wrote:
=IF(H2="","",IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine
Works","Pre Planned Maintenance")))


Erata.

Try this instead as the previous left the 3rd condition open and allowed
for any value to be entered for it...

=IF(H2="PM01","Emergency Works",IF(H2="PM02","Routine
Works",IF(H2="PM03","Pre Planned Maintenance","")))

Cheers
Mick.


All times are GMT +1. The time now is 09:54 AM.

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