Formula for extracting data from a table

olismith89

New Member
Joined
Dec 4, 2014
Messages
12
Hi experts!

I need a bit of help with a tricky formula I'm trying to get done.

Basically, in cell A2, I'm going to be entering a number and that needs to correspond to a table of prices I have. If the number is between:
0-75,000, it needs to be 478.8
75,001-125,000 it should be 634.8
125,001-150,000 it should be 694.8
150,001-175,000 it should be 718.8
175,001-225,000 it should be 778.8
225,001-280,000 it should be 790.8
280,001-500,000 it should be 958.8
500,001-750,000 it should be 1138.8
750,000-1,000,000 it should be 1378.8
and finally if >1,000,000 then it should be 1978.8.

ALSO, I need a separate formula for a similar table with the following prices: (also for an entry into A2)
0-80,000 should be 40
80,001-100,000 should be 80
100,001-200,000 should be 190
200,001-500,000 should be 270
500,001-1,000,000 should be 540
>1,000,000 should be 910

To clarify, if I enter 250,000 into cell A2, the first formula should come back with 790.8 and the second formula should come back 270.

I hope this helps and that some genius can help with this.
 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I put the table of data in columns F, G, and H wherre F is the low end, G is the high end, and H is the value that you want returned.

B2 =IF(AND(A2>=F2,A2<=G2),H2,IF(AND(A2>=F3,A2<=G3),H3... This is for 0-75,000 and 75,001-125,000. Just continue this for all of them.

Second formula is the same idea.
 
Upvote 0
If you can set-up your lookup tables like the below example, you could try something like this:


Excel 2013
ABCDEFGHI
1Table 1AmountTable 2Amount
2250,000790.82700478.8040
375,001634.880,00180
4125,001694.8100,001190
5150,001718.8200,001270
6175,001778.8500,001540
7225,001790.81,000,001910
8280,001958.8
9500,0011138.8
10750,0011378.8
111,000,0011978.8
Sheet1
Cell Formulas
RangeFormula
B2=LOOKUP(A2,$E$2:$E$11,$F$2:$F$11)
C2=LOOKUP(A2,$H$2:$H$7,$I$2:$I$7)
 
Last edited:
Upvote 0
I put the table of data in columns F, G, and H wherre F is the low end, G is the high end, and H is the value that you want returned.

B2 =IF(AND(A2>=F2,A2<=G2),H2,IF(AND(A2>=F3,A2<=G3),H3... This is for 0-75,000 and 75,001-125,000. Just continue this for all of them.

Second formula is the same idea.

Hi thanks for the help. I didn't want a table messing up my document as I'm a bit of a neat freak, so i substituted the cells for actual numbers, but got it all sorted now. Hopefully an easier one for you as you were so quick to reply last time:

If cell D18 is "Y", I need 6, if D18 is "N" I need 30.

Cheers!
 
Upvote 0
=if(d18="y","6",if(d18="n","30"))

it keeps changing caps to lowercase but you get the point...
 
Last edited:
Upvote 0
I didn't want a table messing up my document as I'm a bit of a neat freak

The tables could go into a hidden sheet; but if you insist - here is the LOOKUP() way without the table..


Excel 2013
ABC
2250000790.8270
Sheet1
Cell Formulas
RangeFormula
B2=LOOKUP(A2,{0,75001,125001,150001,175001,225001,280001,500001,750001,1000001},{478.8,634.8,694.8,718.8,778.8,790.8,958.8,1138.8,1378.8,1978.8})
C2=LOOKUP(A2,{0,80001,100001,200001,500001,1000001},{40,80,190,270,540,910})
 
Upvote 0
Sorry, I just noticed that I missed a bit out of the formula and I'm aware I'm being very needy -

If Y, 6 as before, but If N, the 30 needs to be multiplied by a number in column E18
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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