ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Fill a seperate cell with info depending on the input in another c (https://www.excelbanter.com/excel-discussion-misc-queries/118784-fill-seperate-cell-info-depending-input-another-c.html)

Nevermore

Fill a seperate cell with info depending on the input in another c
 
I hope I can put this understandably.

I have 2 columns (A and B) on one worksheet and 2 columns (a2 and b2) and a
second worksheet.

In Column a2 is a range of values (alpha,beta,charlie...zulu) named "list"
In Column b2 is a range of associated costs (1,2,3,4....26)

Column A has a data valadation field using a drop-down list that allows the
user to choose a name (alpha,beta...)

What I need is for Column B to automaticly fill with the associated cost
depending on whichever value is chosen in Coumn A (so if alpha is chose the
adjacent cell is filled with 1, beta..2, charlie..3)

I can not figure out how to do this. The closest I can come is a very ugly
nested IF statement but even that doesn't work as I can't nest 26 IF
statments. Any help would be wonderfull.

Biff

Fill a seperate cell with info depending on the input in another c
 
You want to do a lookup. See if this helps:

http://contextures.com/xlFunctions02.html

Biff

"Nevermore" wrote in message
...
I hope I can put this understandably.

I have 2 columns (A and B) on one worksheet and 2 columns (a2 and b2) and
a
second worksheet.

In Column a2 is a range of values (alpha,beta,charlie...zulu) named "list"
In Column b2 is a range of associated costs (1,2,3,4....26)

Column A has a data valadation field using a drop-down list that allows
the
user to choose a name (alpha,beta...)

What I need is for Column B to automaticly fill with the associated cost
depending on whichever value is chosen in Coumn A (so if alpha is chose
the
adjacent cell is filled with 1, beta..2, charlie..3)

I can not figure out how to do this. The closest I can come is a very ugly
nested IF statement but even that doesn't work as I can't nest 26 IF
statments. Any help would be wonderfull.




Sloth

Fill a seperate cell with info depending on the input in another c
 
Use the VLOOKUP function like this...

=VLOOKUP(A1,{"alpha",1;"beta",2;"charlie",3},2)

or you can insert a small table like this...

C D
1 alpha 1
2 beta 2
3 charlie 3
4 ...

and use a formula like this...

=VLOOKUP(A1,C1:D3,2)

you should be able to expand both formulas to include the entire selection.

"Nevermore" wrote:

I hope I can put this understandably.

I have 2 columns (A and B) on one worksheet and 2 columns (a2 and b2) and a
second worksheet.

In Column a2 is a range of values (alpha,beta,charlie...zulu) named "list"
In Column b2 is a range of associated costs (1,2,3,4....26)

Column A has a data valadation field using a drop-down list that allows the
user to choose a name (alpha,beta...)

What I need is for Column B to automaticly fill with the associated cost
depending on whichever value is chosen in Coumn A (so if alpha is chose the
adjacent cell is filled with 1, beta..2, charlie..3)

I can not figure out how to do this. The closest I can come is a very ugly
nested IF statement but even that doesn't work as I can't nest 26 IF
statments. Any help would be wonderfull.



All times are GMT +1. The time now is 05:17 AM.

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