#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default IF Functions

When one of the values in column 1 shows up
in cell "A1" I need the value across from it in column 2
to show up in cell "B1".
(I'm using a drop down list to place the value in cell "A1")
What is the best way to do this?

M9-4:30 7.5
M3-C 7
r10-4 6
r11-4 5
r4-C 5.5
w11-4 5
w10-4 6
w4-C 5.5
d11-4 5
d4-C 5.5
d12-9 9
c9-4 7
c4-C 6
c12-4 4
c11-4 5
c4-9 5
c5-9 4
c12-8 8

thanks
dzierzekr
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default IF Functions

Say you enter your datalist in Y1 to Z18.

In B1, enter this formula:

=VLOOKUP(A1,$Y$1:$Z$18,2,0)

And you can copy down if needed.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"dzierzekr" wrote in message
...
When one of the values in column 1 shows up
in cell "A1" I need the value across from it in column 2
to show up in cell "B1".
(I'm using a drop down list to place the value in cell "A1")
What is the best way to do this?

M9-4:30 7.5
M3-C 7
r10-4 6
r11-4 5
r4-C 5.5
w11-4 5
w10-4 6
w4-C 5.5
d11-4 5
d4-C 5.5
d12-9 9
c9-4 7
c4-C 6
c12-4 4
c11-4 5
c4-9 5
c5-9 4
c12-8 8

thanks
dzierzekr


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,203
Default IF Functions

If the only allowed entries in A1 are the entries in that 1st column, I would
start by using Data Validation with that list of entries as the source. That
would guarantee that one of them is always chosen.
Then in B1 I would use a VLOOKUP() to match the entry in A1 with its
corresponding entry in the 2-column table and return the associated value
from the second column.

If entries in A1 can be something not from that list in the 2-column table,
then the way you have things now will probably still work, we just have to
modify things in the formula in B1 a little.

I'm going to assume that the entries in the first column of the 2-column
table are on a sheet other than the one where A1 and B1 are involved then to
use it as a list we need to give it a name. Select all of the entries in
that column and in the Name Box, enter a name such as EntryList and press the
[Enter] key. The Name Box is that place right above the 'A' marking column A
and the '1' marking row 1 that usually shows the address of the cell you have
currently selected.

Now we go to cell A1 and choose Data | Validation and then choose List from
the items under "Allow:" and then in the "Source:" area, enter
=EntryList
and close the dialog window.

in B1 enter a formula similar to this:
=VLookup(A1,'Sheet2'!A1:B18,2,False)
Sheet2 should be the name of the sheet that the 2-column table is on, and
A1:B18 should be the cells that define the top-left/bottom right area of that
2-column table.

Now you choose from your list in A1 and related item from the table shows up
in B1. But if what you enter in A1 is not in the list or the cell is still
blank, then #NA is going to appear in B1. Change the formula a little, and
that gets fixed:
=IF(ISNA(VLookup(A1,'Sheet2'!A1:B18,2,False)),"No
Match",VLookup(A1,'Sheet2'!A1:B18,2,False))
or you could change the ,"No Match", to ,"", to show just a blank in B1 when
no match is made, or ,0, to show a zero when no match is made.

Hope this helps.




"dzierzekr" wrote:

When one of the values in column 1 shows up
in cell "A1" I need the value across from it in column 2
to show up in cell "B1".
(I'm using a drop down list to place the value in cell "A1")
What is the best way to do this?

M9-4:30 7.5
M3-C 7
r10-4 6
r11-4 5
r4-C 5.5
w11-4 5
w10-4 6
w4-C 5.5
d11-4 5
d4-C 5.5
d12-9 9
c9-4 7
c4-C 6
c12-4 4
c11-4 5
c4-9 5
c5-9 4
c12-8 8

thanks
dzierzekr

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
Can I get Excel to determine the line curve formula without graph. Cadelima Excel Discussion (Misc queries) 8 December 20th 05 09:57 PM
User-defined functions created in Excel 2000 fail in Excel 2003 goodguy Excel Discussion (Misc queries) 1 October 3rd 05 07:04 PM
Database functions should use criteria in formula, as 1-2-3 does 123user Excel Worksheet Functions 8 September 29th 05 08:57 PM
Are there functions that perform robust statistics in Excel? froot_broot Excel Worksheet Functions 0 August 30th 05 10:18 PM
Visible rows and functions that work tracy Excel Worksheet Functions 2 August 19th 05 05:25 AM


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