Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default 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.
  #2   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default

Quote:
Originally Posted by Jay07 View Post
=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!
  #3   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by Jay07 View Post
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"))
:)
  #4   Report Post  
Member
 
Location: Birmingham
Posts: 35
Thumbs up

Quote:
Originally Posted by Spencer101 View Post
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
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 259
Default 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.


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 259
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What do I do wrong [Excuses pushing the wrong key combination earlier] Vsn Excel Programming 7 November 8th 09 09:12 PM
What is wrong? Max Excel Discussion (Misc queries) 0 February 5th 09 02:40 AM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
What is wrong with this bach Excel Discussion (Misc queries) 0 September 6th 05 09:09 AM
What's Wrong with This? D[_6_] Excel Programming 9 June 18th 04 05:50 PM


All times are GMT +1. The time now is 03:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"