How to accomplish auto generate.

Sithtechnology

New Member
Joined
Mar 12, 2018
Messages
3
What I am trying to do is to type a site ID on a field, and in next filed auto populate market id.

Example Site ID - IL12345, Market IL

So the first two letters would auto populate market ID.

Any help is appreciated.

Thanks
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

Do you already have a list of states, and their abbreviations?

if so, put them in to 2 columns with the abbreviation in the first column, and the state in the second. Highlight the 2 columns and name the range by typing states in to the small box next to the formula bar.

then in your main sheet, type the following formula in to the field you want the result in. =vlookup(left(a1,2),states,2,false) where a1 is the cell with your site id in.

Regards,

Dan.
 
Upvote 0
So one column is the Market ID the other is Site ID, will it know what market id to choose by just typing the first two letters of the site ID?
Market ID Examples, AR, CH, ML. Site ID examples AR16789, CH67253, ML93907A
 
Upvote 0
do you have a list of Market ID's? if so, create 1 column with the market id, and one with the abbreviation eg
ILMarket ID1
ACMarket ID2
BKMarket ID3
DGMarket ID 4

<tbody>
</tbody>

Name that range as per last email, with any name you like eg(tolookup)

Then in the sheet you have the sites ID's in:

IL12345some infosome info=vlookup(left(a1,2),tolookup,2,false)
AC4567some infosome info=vlookup(left(a2,2),tolookup,2,false)
BK9876some infosome info=vlookup(left(a3,2),tolookup,2,false)
DG7548some infosome info=vlookup(left(a4,2),tolookup,2,false)

<tbody>
</tbody>

you could prepopulate the formula down, but in its current form would display N/a it there is no value in the site id cell. you can fix this by changing the formula to =ifna(vlookup(left(a1,2),tolookup,2,false),"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,746
Messages
6,126,647
Members
449,325
Latest member
Hardey6ix

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