Help Please

PhilWong

New Member
Joined
May 20, 2018
Messages
4
How do I write a formula for the yellow box that will return a category in column D from the spend value.

SpendCategory
£5,323.24
ABCD
1£0>=1
2£2,500>=1
3£2,501>=2
4£5,000>=2
5£5,001>=3
6£10,000>=3
7£10,001>=4
8£25,000>=4
9£25,001>=5
10£50,000>=5
11£50,001>=6
12£100,000>=6
13£100,001>=7
<colgroup><col width="33" style="width: 25pt; mso-width-source: userset; mso-width-alt: 1206;"> <col width="75" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2742;" span="3"> <tbody> </tbody>
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Happy to help, glad it worked. Thanks for the feedback.

Just as a side note, it's the "TRUE" argument that is important in your case. Approximate match = nearest but not greater than. If you change the order of your table, it will give you a result you're not expecting. If you don't use FALSE for the last argument, your table MUST be sorted A->Z (or low to high, however you want to look at it).

For instance, this:


Book1
BCD
15323.243
20>=1
32500>=1
42501>=2
55000>=2
65001>=3
710000>=3
810001>=4
925000>=4
1025001>=5
1150000>=5
1250001>=6
13100000>=6
14100001>=7
Sheet1
Cell Formulas
RangeFormula
D1=VLOOKUP(B1,B2:D14,3,TRUE)


gives the correct result, while this:


Book1
BCD
15323.24#N/A
2100001>=7
3100000>=6
450001>=6
550000>=5
625001>=5
725000>=4
810001>=4
910000>=3
105001>=3
115000>=2
122501>=2
132500>=1
140>=1
Sheet1
Cell Formulas
RangeFormula
D1=VLOOKUP(B1,B2:D14,3,TRUE)


returns an error.
 
Upvote 0
And by the way, if you DO use "FALSE" as the last argument...in your case, you won't get a result at all. It will be looking for 5323.24 and won't find it...and so will result in an error.


Book1
BCD
15323.24#N/A
20>=1
32500>=1
42501>=2
55000>=2
65001>=3
710000>=3
810001>=4
925000>=4
1025001>=5
1150000>=5
1250001>=6
13100000>=6
14100001>=7
Sheet1
Cell Formulas
RangeFormula
D1=VLOOKUP(B1,B2:D14,3,FALSE)
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,676
Members
449,463
Latest member
Jojomen56

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