If statements & vlookup

Lee75_UK

New Member
Joined
Jun 6, 2011
Messages
8
Hi,

I am using excel 2003 and trying to make a lookup work based on 3 different scenarios.

In sheet 1 (named data) I have the following columns.

A = ABV (can be a range between 2.0 & 9.0)
B = Date (production date)
c = Rate (Tax rate, based on the tax rate on a specific date)

In sheet 2 (named lookup) i have the following columns.

A = Date (production date)
B = Tax rate 1 between 2.9 & 7.5 = £18.57
C = Tax rate 2 <= 2.8 = £9.29
D = Tax rate 3 > 7.5 = £23.21

What I am trying to do is if 'Data A' = > 7.5 then use the production date in 'Data B' and match that to the date in 'lookup A' and return the rate from 'lookup D'

and the same for the other 2 tax rate ranges.

I have created the following formula but in when I enter a tax rate of 2 or 3, i get #REF returned.

=IF(A2>7.5,VLOOKUP(B2,lookup!A3:D32,4,0),IF(A2<=2.8,VLOOKUP(B2,lookup!A3:D32,3,0),VLOOKUP(B2,lookup!A3:D32,2,0)))

Note, this formula works as expected in excel 2007.

Any help is much appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I don't see why the formula wouldn't work in 2003...

I would suggest replacing the column number with an IF statement as that's the only part that changes. Or use something like:
=VLOOKUP(B2,lookup!A3:D32,CHOOSE(MATCH(A2,{0,2.9,7.5,7.6},1),3,2,2,4),FALSE)
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,818
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top