#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default If statement

In cell H4 I want one of three model numbers to appear. Each model number is
assigned a value, so 1112111 will equal HRV019SB1. So the formula for H4 is,
as of now, =IF(H4=1112111,"HRV019SB1"). And that works great if 1112111
appears. How do I write the formula for multiple values, so if 2112111
appears, a different model number will be shown.

Here's my example
1112111=HRV019SB1
2112111=HRH019SB1
1113111=HRV024SB1
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Location: Bakersfield, CA
Posts: 45
Send a message via Skype™ to JBeaucaire[_85_]
Default If statement

You can stack the IF statements all into one:

=IF(H4=1112111,"HRV019SB1",IF(H4=2112111,"HRH019SB 1",IF(H4=1113111,"HRV024SB1","not found"))).

That works, but you can only go 7 deep that way on Excel 2003. You could
build a lookup table in a formula as long as you remember to keep the numeric
values in ascending order, like so:

=LOOKUP(H4,{1112111,1113111,2112111},{"HRV019SB1", "HRV024SB1","HRH019SB1"})
--
"Actually, I AM a rocket scientist." -- JB


"Zack" wrote:

In cell H4 I want one of three model numbers to appear. Each model number is
assigned a value, so 1112111 will equal HRV019SB1. So the formula for H4 is,
as of now, =IF(H4=1112111,"HRV019SB1"). And that works great if 1112111
appears. How do I write the formula for multiple values, so if 2112111
appears, a different model number will be shown.

Here's my example
1112111=HRV019SB1
2112111=HRH019SB1
1113111=HRV024SB1

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
Sum if statement with a left statement Eric D Excel Discussion (Misc queries) 4 July 23rd 08 05:31 PM
SUMIF statement with AND statement Eric D Excel Discussion (Misc queries) 2 July 14th 08 07:24 PM
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 07:04 PM.

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"