Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 661
Default What is an alternative to nested IF statements?

Consider two rows of cells. The cells in the first row have names picked
from a validation drop down list. I'd like each of the names to correspond
to a specific number which needs to populate in the cell below the name. So
if I pick cell A1 to be John, A2 should be 6. If I pick B1 to be Sally, B2
should be 89. I'd like to create a table somewhere that lets me list the
names with their respective values.

I know I can write something like...
If(A1 = "john", 6)
....but how does one accomplish this with 20 or so names?

Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default What is an alternative to nested IF statements?

how does one accomplish this with 20 or so names?

The best approach is to create a 2 column table with the names in the left
column and the corresponding number in the right column. Like this:

...........G..........H.....
1......John........6.....
2......Sally........89...
3......Tom........40...
4......Lisa.........33...

Then, you would use a formula like this in A2:

=IF(A1="","",VLOOKUP(A1,$G$1:$H$4,2,0))

Then you can copy the formula across the row as needed.


--
Biff
Microsoft Excel MVP


"Paul" wrote in message
...
Consider two rows of cells. The cells in the first row have names picked
from a validation drop down list. I'd like each of the names to
correspond
to a specific number which needs to populate in the cell below the name.
So
if I pick cell A1 to be John, A2 should be 6. If I pick B1 to be Sally,
B2
should be 89. I'd like to create a table somewhere that lets me list the
names with their respective values.

I know I can write something like...
If(A1 = "john", 6)
...but how does one accomplish this with 20 or so names?

Thank you!



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
Nested IF fn Alternative Dave Excel Discussion (Misc queries) 6 August 20th 07 08:16 PM
Nested IF statements maacmaac Excel Discussion (Misc queries) 0 January 23rd 06 09:22 PM
Nested Vlookup or alternative? scoobydoo99 Excel Worksheet Functions 2 October 28th 05 02:38 PM
Help with Nested If Statements THEFALLGUY Excel Discussion (Misc queries) 6 September 3rd 05 10:03 AM
Do I need nested IF statements? Jaramya Excel Worksheet Functions 1 November 5th 04 09:10 PM


All times are GMT +1. The time now is 11:31 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"