Probably a simple task though amateur struggling

Watsoa

New Member
Joined
Mar 2, 2011
Messages
8
Please could someone help me out with a little problem i have.

I currently have a table A1:B5 in which column A reads values 10-20-30-40-50 and column B reads S/M/L/XL/XXL

I want a function so that if the user inputs 15 into a cell, it will look-up into the table and match to the next size up.....ie, 15 would match to 20 and display M.........37 would match to 40 and display XL....41 would match to 50 and display XXL.

Currently have been trying IF/AND though im tying myself in knots

Hope someone can help me out, much appreciated A.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
If you're able to have the size limits be minimums instead of Maximums, then you could use a simple VLOOKUP function...
Excel Workbook
ABCDE
10S15M
210M
320L
430XL
540XXL
650Too Big
...
Cell Formulas
RangeFormula
E1=VLOOKUP(D1,A1:B6,2,1)
 
Upvote 0
Ahhh, i hadnt thought of it like that. Brilliant, makes it a whole lot easier.

Thanks muchly :):):):)
 
Upvote 0
Perhaps I've mis-understood, but doesn't that give an incorrect result when the lookup value actually occurs in the table? For example, it returns "L" for a lookup value of 20. Shouldn't it return "M" for 20?

If so then since your size gaps are all 10, I'd suggest the formula in E1. If the size gaps were not even, then you could use the formula in F1.

Excel Workbook
ABCDEF
1020MM
210S25LL
320M3SS
430L48XXLXXL
540XL
650XXL
Lookup
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,718
Members
452,939
Latest member
WCrawford

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