Looking up a value with and without leading 0-s from a table, XL2BB added

Rxbxrt

New Member
Joined
Jan 16, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

Purpose of this is to enter a 5 digit number into cell A2, that number should be looked up from the ranges in table A4:B38, then according to which range the 5 digit number falls into, correct value (header "Zone") from C4:C38 must be returned to cell B3.

Also as seen from the table A4:B38, the 5 digit number can be with leading 0-s (for example 00001). How to solve it so that all 5 number digits either starting with a 0 or not can be found and the corresponding "Zone" number will be returned?

Terminalide kalkulaatorid 10.01.2025.xlsx
ABCD
1CodeZone
224999
3
4Range startRange endZone
500001059991
606000249992
725000262994
826300269992
927000349994
1035000369993
1137000399994
1240000419993
1342000424994
1442500426993
1542700440994
1644100441993
1744200499994
1850000551993
1955200563994
2056400564993
2156500599994
2260000620993
2362100629994
2463000630993
2563100639994
2664000645993
2764600799994
2880000819993
2982000820994
3082100823993
3182400829994
3283000830993
3383100899994
3490000974992
3597500975994
3697600982992
3798300984994
3898500999992
39
PL HWL (2)
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try:
Excel Formula:
=XLOOKUP(--A2,--A5:A38,C5:C38,,-1)
 
Upvote 0
Solution

Forum statistics

Threads
1,226,112
Messages
6,189,039
Members
453,520
Latest member
packrat68

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