Looking for a formula to return a certain number from a list

MrJeremy

New Member
Joined
Aug 28, 2014
Messages
8
Okay I want to do a sort of a IF statement, but not sure the exact way to do it.

I have a column full of city names, and another column with a specific list of cities

I need a formual that will return a "A" in the empty column next to the full list of cities if it the first city on the specific list, or a "B" if it is the 2nd city on the list.

Thanks in advance!
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I don't quite understand. Can you post an example of what your data looks like now, and what you would like it to look like after the formula?
 
Upvote 0
Okay...here is a sample list I created...I want the Formula column to auto fill in the list based off the information on the right. Thanks!

duz72Xf.jpg
 
Upvote 0
Hello,

Welcome to the forums! If I understand you correctly, is this what you want?


Formula in cell B2:
Code:
=IF($D$2=A2,"A",IF($D$3=A2,"B",""))

Then you drag down this formula.
List of CitiesValueBest Cities
OrlandoLa Crosse
New YorkBNew York
Chicago
Madison
San Diago
Mauston
La CrosseA
Las Vegas
Boston
Miami

<TBODY>
</TBODY>
 
Upvote 0
Hey Jeremy,

Entire list? That should be the full formula and then you just copy that formula down to each cell below it. Unless there is more conditions you didn't mention?

Regards,
Alex
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

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