Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - IF or LOOKUP - Please help!

Status
Not open for further replies.

galesjam

Technical User
Sep 20, 2002
10
FI
I'm trying to create a IF or LOOKUP function, but not getting very far as I am not very good with functions! I want to look at a specific cell on Worksheet 2, and if it contains a certain value (eg. "B") then the value from a specific cell on worksheet 1 will appear in a specific cell on worksheet 2. Does that makes sense!?!?

Let me try again.
IF WS2(COL A/ROW 1)= either 'B or RO or B&D or FB or AI'
THEN the value in WS1 (COL B/ROW 2) will appear in WS2(COL B/ROW 1).

Examples of the worksheets:

WS1 has:
COL A COL B
ROW 1 RO £1000
ROW 2 B £800
ROW 3 B&D £600
ROW 4 FB £400
ROW 5 AI £200


WS2 has:
COL A COL B
ROW 1 ? ?

Sorry if it's not easy to follow (not sure of the best way to write it)
Can anyone help?
 
in WS2, formula is

=if(or(ws1!A1="B",ws1!A1="RO",ws1!A1="B&D",ws1!A1="FB",ws1!A1="AI"),ws1!B2,"")

but are you sure you want to compare ws2 row 2 with ws1 row 1 ??

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Thanks, but that doesn't quite work.
It only returns one value no matter what (the value of ws1!B2).

Maybe I have not explained it properly.

WS1:
Col1 Col2
Row1 RO £1000
Row2 B £800
Row3 B&D £600
Row4 FB £400
Row5 AI £200

WS2:
Row1/Col1='I type either RO, B, B&D, FB or AI here'
Row2/Col2='Function'

So depending on what I type in WS2(Row1/Col1) affects the value that is shown in WS2(Row2/Col2) & the lookup table is as WS1.

Is that any better?
 
=VLOOKUP(WS2!A1,WS1!A:B,2,FALSE)

put that in WS1 B2



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
=VLOOKUP(WS2!A1,WS1!A:B,2,FALSE)

put that in WS2 B2



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Thanks 'bluedrangon2' that works a treat!
Just had to adjust it a little as my cols were further apart.
 
Glad to have been of assistance



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top