More dynamic vlookup formula that will allow to search a certain digits of number

feni1388

Board Regular
Joined
Feb 19, 2018
Messages
137
Office Version
  1. 2021
Platform
  1. Windows
Hello everyone....

I want to know whether it's possible to replace below formula with something more dynamic or not.

Excel Formula:
=VLOOKUP(VALUE(LEFT(A2,7)),F:G,2,FALSE)

My table data is as the following.

The problem is that the invoice number will grow to 8 digits and maximum 10 digits before it will be reset and go back to 1 digit number.
So is it possible to change the above formula to something that will vlookup only the numbers (no matter how many digits there're)?

Book1
ABCDEFG
1Invoice No.ResultInvoice No.Result
21000013 Total15100001315
31000014 Total1001000014100
41000015 Total30100001530
51000016 Total35100001635
61000017 Total40100001740
71000018 Total1501000018150
81000019 Total2001000019200
91000020 Total2251000020225
101000021 Total89100002189
111000022 Total90100002290
121000023 Total95100002395
131000024 Total1351000024135
141000025 Total2501000025250
151000026 Total2751000026275
161000027 Total55100002755
Sheet1
Cell Formulas
RangeFormula
B2:B16B2=VLOOKUP(VALUE(LEFT(A2,7)),F:G,2,FALSE)


Thank you in advance.
 
Now I tried the second one, and it returned SPILL .... just like Cubist's formula.
Delete all the cells below the first formula. My second formula (& Cubists) provide all the results from a single formula. It should not be copied down the column and all the cells below the formula should be empty to start with.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Delete all the cells below the first formula. My second formula (& Cubists) provide all the results from a single formula. It should not be copied down the column and all the cells below the formula should be empty to start with.
Ah... I see...
I deleted everything below the first formula and it worked... thank you
 
Upvote 0
I deleted everything below the first formula and it worked... thank you
Cheers. Thanks for the confirmation. So the point was that you can get all the results with a single formula rather than 15 formulas, or maybe hundreds or thousands of formulas if your full data is larger.
 
Upvote 0

Forum statistics

Threads
1,225,611
Messages
6,185,994
Members
453,334
Latest member
Prakash Jha

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