If statement or Vlookup formula help

kumar1803

Board Regular
Joined
Jan 7, 2015
Messages
110
I have 500 rows of 6 digit numbers where I need to assigned a unique value based on first three digit of the number:

For example: 100000-199999 Assign value U023
200000-299999 Assign Value U220
300000-366999 Assign Value U222
367000-399999 Assign Value U367
670000-679999 Assign Value U 327

I can then just vlook up any value if they fall in the above table to get the value assign.

Here are the 6 digit value I have

[TABLE="width: 96"]
<tbody>[TR]
[TD]100187[/TD]
[/TR]
[TR]
[TD]100188[/TD]
[/TR]
[TR]
[TD]130140[/TD]
[/TR]
[TR]
[TD]130143[/TD]
[/TR]
[TR]
[TD]130164[/TD]
[/TR]
[TR]
[TD]130184[/TD]
[/TR]
[TR]
[TD]130327[/TD]
[/TR]
[TR]
[TD]130385[/TD]
[/TR]
[TR]
[TD]130386[/TD]
[/TR]
[TR]
[TD]130451[/TD]
[/TR]
[TR]
[TD]140268[/TD]
[/TR]
[TR]
[TD]367115[/TD]
[/TR]
[TR]
[TD]367140[/TD]
[/TR]
[TR]
[TD]367149[/TD]
[/TR]
[TR]
[TD]367194[/TD]
[/TR]
[TR]
[TD]367325[/TD]
[/TR]
[TR]
[TD]367362[/TD]
[/TR]
[TR]
[TD]367366[/TD]
[/TR]
[TR]
[TD]367373[/TD]
[/TR]
[TR]
[TD]367374[/TD]
[/TR]
[TR]
[TD]100188[/TD]
[/TR]
[TR]
[TD]130142[/TD]
[/TR]
[TR]
[TD]130370[/TD]
[/TR]
[TR]
[TD]130373[/TD]
[/TR]
[TR]
[TD]130376[/TD]
[/TR]
[TR]
[TD]130386[/TD]
[/TR]
[TR]
[TD]130387[/TD]
[/TR]
[TR]
[TD]130654[/TD]
[/TR]
[TR]
[TD]130663[/TD]
[/TR]
[TR]
[TD]210137[/TD]
[/TR]
[TR]
[TD]210161[/TD]
[/TR]
[TR]
[TD]210185[/TD]
[/TR]
[TR]
[TD]367362[/TD]
[/TR]
[TR]
[TD]367631[/TD]
[/TR]
[TR]
[TD]100112[/TD]
[/TR]
[TR]
[TD]100113[/TD]
[/TR]
[TR]
[TD]100116[/TD]
[/TR]
[TR]
[TD]100120[/TD]
[/TR]
[TR]
[TD]100131[/TD]
[/TR]
[TR]
[TD]100132[/TD]
[/TR]
[TR]
[TD]100133[/TD]
[/TR]
[TR]
[TD]100135[/TD]
[/TR]
[TR]
[TD]100137[/TD]
[/TR]
[TR]
[TD]100138[/TD]
[/TR]
[TR]
[TD]100139[/TD]
[/TR]
[TR]
[TD]100140[/TD]
[/TR]
[TR]
[TD]100141[/TD]
[/TR]
[TR]
[TD]100145[/TD]
[/TR]
[TR]
[TD]100161[/TD]
[/TR]
[TR]
[TD]100162[/TD]
[/TR]
[TR]
[TD]100163[/TD]
[/TR]
[TR]
[TD]100167[/TD]
[/TR]
[TR]
[TD]100168[/TD]
[/TR]
[TR]
[TD]100170[/TD]
[/TR]
[TR]
[TD]100171[/TD]
[/TR]
[TR]
[TD]100180[/TD]
[/TR]
[TR]
[TD]100181[/TD]
[/TR]
[TR]
[TD]100182[/TD]
[/TR]
[TR]
[TD]100183[/TD]
[/TR]
[TR]
[TD]100185[/TD]
[/TR]
[TR]
[TD]100186[/TD]
[/TR]
[TR]
[TD]100187[/TD]
[/TR]
[TR]
[TD]100188[/TD]
[/TR]
[TR]
[TD]100189[/TD]
[/TR]
[TR]
[TD]100265[/TD]
[/TR]
[TR]
[TD]100631[/TD]
[/TR]
[TR]
[TD]110265[/TD]
[/TR]
[TR]
[TD]110613[/TD]
[/TR]
[TR]
[TD]130137[/TD]
[/TR]
[TR]
[TD]130140[/TD]
[/TR]
[TR]
[TD]130142[/TD]
[/TR]
[TR]
[TD]130143[/TD]
[/TR]
[TR]
[TD]130148[/TD]
[/TR]
[TR]
[TD]130151[/TD]
[/TR]
[TR]
[TD]130152[/TD]
[/TR]
[TR]
[TD]130166[/TD]
[/TR]
[TR]
[TD]130168[/TD]
[/TR]
[TR]
[TD]130170[/TD]
[/TR]
[TR]
[TD]130178[/TD]
[/TR]
[TR]
[TD]130180[/TD]
[/TR]
[TR]
[TD]130184[/TD]
[/TR]
[TR]
[TD]130187[/TD]
[/TR]
[TR]
[TD]130192[/TD]
[/TR]
[TR]
[TD]130315[/TD]
[/TR]
[TR]
[TD]130316[/TD]
[/TR]
[TR]
[TD]130325[/TD]
[/TR]
[TR]
[TD]130326[/TD]
[/TR]
[TR]
[TD]130327[/TD]
[/TR]
[TR]
[TD]130350[/TD]
[/TR]
[TR]
[TD]130352[/TD]
[/TR]
[TR]
[TD]130353[/TD]
[/TR]
[TR]
[TD]130360[/TD]
[/TR]
[TR]
[TD]130361[/TD]
[/TR]
[TR]
[TD]130362[/TD]
[/TR]
[TR]
[TD]130365[/TD]
[/TR]
[TR]
[TD]130370[/TD]
[/TR]
[TR]
[TD]130371[/TD]
[/TR]
[TR]
[TD]130373[/TD]
[/TR]
[TR]
[TD]130374[/TD]
[/TR]
[TR]
[TD]130375[/TD]
[/TR]
[TR]
[TD]130376[/TD]
[/TR]
[TR]
[TD]130377[/TD]
[/TR]
[TR]
[TD]130378[/TD]
[/TR]
[TR]
[TD]130379[/TD]
[/TR]
[TR]
[TD]130381[/TD]
[/TR]
[TR]
[TD]130383[/TD]
[/TR]
[TR]
[TD]130385[/TD]
[/TR]
[TR]
[TD]130386[/TD]
[/TR]
[TR]
[TD]130387[/TD]
[/TR]
[TR]
[TD]130388[/TD]
[/TR]
[TR]
[TD]130398[/TD]
[/TR]
[TR]
[TD]130410[/TD]
[/TR]
[TR]
[TD]130420[/TD]
[/TR]
[TR]
[TD]130421[/TD]
[/TR]
[TR]
[TD]130422[/TD]
[/TR]
[TR]
[TD]130423[/TD]
[/TR]
[TR]
[TD]130427[/TD]
[/TR]
[TR]
[TD]130441[/TD]
[/TR]
[TR]
[TD]130444[/TD]
[/TR]
[TR]
[TD]130445[/TD]
[/TR]
[TR]
[TD]130446[/TD]
[/TR]
[TR]
[TD]130451[/TD]
[/TR]
[TR]
[TD]130452[/TD]
[/TR]
[TR]
[TD]130453[/TD]
[/TR]
[TR]
[TD]130456[/TD]
[/TR]
[TR]
[TD]130617[/TD]
[/TR]
[TR]
[TD]130618[/TD]
[/TR]
[TR]
[TD]130619[/TD]
[/TR]
[TR]
[TD]130620[/TD]
[/TR]
[TR]
[TD]130625[/TD]
[/TR]
[TR]
[TD]130627[/TD]
[/TR]
[TR]
[TD]130628[/TD]
[/TR]
[TR]
[TD]130630[/TD]
[/TR]
[TR]
[TD]130633[/TD]
[/TR]
[TR]
[TD]130634[/TD]
[/TR]
[TR]
[TD]130635[/TD]
[/TR]
[TR]
[TD]130654[/TD]
[/TR]
[TR]
[TD]130663[/TD]
[/TR]
[TR]
[TD]130681[/TD]
[/TR]
[TR]
[TD]140268[/TD]
[/TR]
[TR]
[TD]160610[/TD]
[/TR]
[TR]
[TD]160611[/TD]
[/TR]
[TR]
[TD]160613[/TD]
[/TR]
[TR]
[TD]160614[/TD]
[/TR]
[TR]
[TD]160616[/TD]
[/TR]
[TR]
[TD]160619[/TD]
[/TR]
[TR]
[TD]210112[/TD]
[/TR]
[TR]
[TD]210113[/TD]
[/TR]
[TR]
[TD]210120[/TD]
[/TR]
[TR]
[TD]210127[/TD]
[/TR]
[TR]
[TD]210128[/TD]
[/TR]
[TR]
[TD]210129[/TD]
[/TR]
[TR]
[TD]210132[/TD]
[/TR]
[TR]
[TD]210133[/TD]
[/TR]
[TR]
[TD]210137[/TD]
[/TR]
[TR]
[TD]210138[/TD]
[/TR]
[TR]
[TD]210139[/TD]
[/TR]
[TR]
[TD]210140[/TD]
[/TR]
[TR]
[TD]210141[/TD]
[/TR]
[TR]
[TD]210143[/TD]
[/TR]
[TR]
[TD]210144[/TD]
[/TR]
[TR]
[TD]210149[/TD]
[/TR]
[TR]
[TD]210150[/TD]
[/TR]
[TR]
[TD]210161[/TD]
[/TR]
[TR]
[TD]210162[/TD]
[/TR]
[TR]
[TD]210163[/TD]
[/TR]
[TR]
[TD]210180[/TD]
[/TR]
[TR]
[TD]210181[/TD]
[/TR]
[TR]
[TD]210182[/TD]
[/TR]
[TR]
[TD]210183[/TD]
[/TR]
[TR]
[TD]210184[/TD]
[/TR]
[TR]
[TD]210185[/TD]
[/TR]
[TR]
[TD]210188[/TD]
[/TR]
[TR]
[TD]210189[/TD]
[/TR]
[TR]
[TD]300170[/TD]
[/TR]
[TR]
[TD]367110[/TD]
[/TR]
[TR]
[TD]367115[/TD]
[/TR]
[TR]
[TD]367128[/TD]
[/TR]
[TR]
[TD]367137[/TD]
[/TR]
[TR]
[TD]367138[/TD]
[/TR]
[TR]
[TD]367140[/TD]
[/TR]
[TR]
[TD]367141[/TD]
[/TR]
[TR]
[TD]367144[/TD]
[/TR]
[TR]
[TD]367146[/TD]
[/TR]
[TR]
[TD]367149[/TD]
[/TR]
[TR]
[TD]367157[/TD]
[/TR]
[TR]
[TD]367158[/TD]
[/TR]
[TR]
[TD]367159[/TD]
[/TR]
[TR]
[TD]367162[/TD]
[/TR]
[TR]
[TD]367172[/TD]
[/TR]
[TR]
[TD]367173[/TD]
[/TR]
[TR]
[TD]367174[/TD]
[/TR]
[TR]
[TD]367175[/TD]
[/TR]
[TR]
[TD]367176[/TD]
[/TR]
[TR]
[TD]367179[/TD]
[/TR]
[TR]
[TD]367186[/TD]
[/TR]
[TR]
[TD]367187[/TD]
[/TR]
[TR]
[TD]367188[/TD]
[/TR]
[TR]
[TD]367189[/TD]
[/TR]
[TR]
[TD]367191[/TD]
[/TR]
[TR]
[TD]367194[/TD]
[/TR]
[TR]
[TD]367325[/TD]
[/TR]
[TR]
[TD]367361[/TD]
[/TR]
[TR]
[TD]367362[/TD]
[/TR]
[TR]
[TD]367363[/TD]
[/TR]
[TR]
[TD]367366[/TD]
[/TR]
[TR]
[TD]367367[/TD]
[/TR]
[TR]
[TD]367368[/TD]
[/TR]
[TR]
[TD]367372[/TD]
[/TR]
[TR]
[TD]367373[/TD]
[/TR]
[TR]
[TD]367374[/TD]
[/TR]
[TR]
[TD]367451[/TD]
[/TR]
[TR]
[TD]367616[/TD]
[/TR]
[TR]
[TD]367631[/TD]
[/TR]
[TR]
[TD]367650[/TD]
[/TR]
[TR]
[TD]100182[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Vlookup will work.


put the following data in cells D1:E6

100000 U023
200000 U220
300000 U222
367000 U367
670000 U327
680000 MAX


the this formual in B2 and Fill down
=VLOOKUP(A2,D:E,2)
 
Upvote 0
Hi,

I tried with the above formula, but all came with N/A as it did not exactly find the value as you can see the numbers above in my question.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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