PDA

View Full Version : [SOLVED:] Syntax for 'LookUp' command? Help...



Lester
11-02-2007, 03:24 AM
Hi
Still struggling with VBA, unfortunately.

[see attachment]
Anyway, I need to lookup data in column F ('Labour/Consultant') of worksheet 'Charge Rates Look-up' based on data in columns A, B and D of worksheet 6, then 'paste' it into empty column J of sheet 6.
I have tried the following function in cell J2, but it is clearly wrong, as the expected value does not appear in the cell:

VLOOKUP(--('Charge Rates Look-up'!$A$1:$A$87=Sheet6!A2), --('Charge Rates Look-up'!$B$1:$B$87=Sheet6!B2), --('Charge Rates Look-up'!$D$1:$D$87=Sheet6!D2),'Charge Rates Look-up'!$F$1:$F$87)
Please help.
Many thanks
Lester.

Lester
11-02-2007, 04:27 AM
Any takers? Please?

figment
11-02-2007, 04:47 AM
i had to add a column to you sheet, but it appers to work. your problem was you were not useing the corect inputs for the vlookup equation.

7164

Lester
11-02-2007, 04:53 AM
Thanks for trying, figment, but what I should end up with is, cells in column J filled with 'Labour' or 'Consultant'. Your version has a column of numbers.

Your syntax looks more readable than mine...hopefully a step in the right direction

Cheers

figment
11-02-2007, 05:06 AM
to get the right output you need to change the third input into the vlookup function from a 6 to a 7

Lester
11-02-2007, 05:41 AM
thanks, figment...I see what you've done...you created a unique identifier for each entry in the lookup table. That's ingenious.

In my case, i feel i wont be allowed to create a new column like that...if I don't find a solution using only the original data (i.e. no new column), I may have reason to use your solution.

Many thanks again.

cheers.
Lester