HLookup but searching for the nearest number, not necessarily the exact match

Neilads

New Member
Joined
Jun 29, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello,

I am in need of a clever formula that can help me cost the the number of A3 sheets, when we are printing A4s on them (2up). My current formula only calculates for sheets when they are A3 size...

I am looking for a way to find the cost of the paper sheet from the C column for the A4 Sizes (to be displaed in column H). The issue is that we can get 2 x A4 out of an A3, and when we print 500 A4s, we only use 250 A3s, therefore the calculation needs to say the sheet cost when using 250 sheets, not 500. The column that needs to have the formula in is Column H. I tried HLookup, but it only returned exact matches, where it could drop down to the nearest value below when it doesn't find an exact match. For example, for 350 A4s, 177 sheets will be used. There isn't a value in the B column that shows 177, but the nearest below it is 172, which would be fine to use.

Can you help?
 

Attachments

  • Formula hlookup.jpg
    Formula hlookup.jpg
    166.8 KB · Views: 8

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
To get the next lower value, try
Excel Formula:
=XLOOKUP(G3,$B$3:$B$1000,$C$3:$C$1000,"",-1)
 
Upvote 0
Amazing! That's worked a treat. Thank you so much.
It's hard enough knowing how to ask the question, but you've solved the riddle for me and that really helps, so thank you.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,276
Messages
6,124,006
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