Check if number is within range

Mr_Molesely

New Member
Joined
Nov 18, 2021
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hello! Hope somebody can kindly help

I have a charging table e.g.

No of itemsCharge
1-5£2.50
6-19£6.30
20-45£9.99

I want to be able to put a input cell where I can enter number of items e.g. 8 which will then lookup column 1 and then give me the associated charge (here it will be 6-19 items so £6.30)

Is there an elegant method to to work this out? I can tweak the format of the No of Items column but I cannot split into separate columns.

Thanks,
Moley
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Split the first column as A and B.
Formula will be:
Excel Formula:
=VLOOKPUP(input_cell,$A$1:$C$4,3,1)
 
Upvote 0
MrExcelPlayground12.xlsx
AB
20No ItemsPrice
211-5$2.50
226-19$6.30
2320-45$9.99
24
25
26Items
278$6.30
Sheet22
Cell Formulas
RangeFormula
B27B27=LET(o,B21:B23,I,A21:A23,j,A27,sm,VALUE(LEFT(I,SEARCH("-",I)-1)),lg,VALUE(MID(I,SEARCH("-",I)+1,99)),x,(j>=sm)*(j<=lg),FILTER(o,x))
 
Upvote 0
Thank you, I've used Flashbonds example for now even though I specifically did not want to split into separate columns but I will have a go at James's new Let method soon, You gentlemen/women? are amazing and are helping to solve real business problems!
 
Upvote 0

Forum statistics

Threads
1,215,274
Messages
6,123,995
Members
449,137
Latest member
abdahsankhan

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