Auto fill cell depending on what is in neighboring cell. Possibly an IF function.

fatgeek

New Member
Joined
Mar 15, 2013
Messages
4
Ok, I'm sure for someone a lot better with Excel than I am this is easy.

I have a spreadsheet where I have employee names in column A, work locations in column B. I would like to have a third column where their supervisor's name is filled depending on the work location in column B.

Basicially I would like:

ABC
JohnNorthSUPV A
JoeSouthSUPV B
JackSouthSUPV B
JanetNorthSUPV A
JaniceEastSUPV C

<tbody>
</tbody>

And so on and so forth where it would fill column c appropriately based on the contents of the neighboring cell in column B. I do a little coding, so I know I could do this with an if statement, but I don't know how to get that working with Excel.

Thanks in advance
 

Excel Facts

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

Try

=IF(B1="East","SUPV C",IF(B1="West","SUPV D",IF(B1="North","SUPV A",IF(B1="South","SUPV B",""))))

Jai
 
Upvote 0
Just to help me understand what is going on:

It looks like what you provided was a bunch of nested IF statements, and the syntax is basically:

IF(cell="i",then,else)

Am I reading that correctly?
 
Upvote 0
You are correct. Basically, what he did was a nested "if this location, then this sup, else if this location, then this sup, else...".

I believe a VLOOKUP works and a separate table works better but for simplicity's sake, this is perfect. :)
 
Upvote 0
Depending upon how many "supervisors" there are, as there are a limit to the number of nested if statements in some versions of excel, then either the If function as mentioned above (or below depending upon how you're reading the thread) or a Vlook up are the two main ways i would suggest. You could even prefix with
If(ISBLANK(B1),"",---- then the VLook Up formula. The If above takes care of this already with the final "", vlook up would tend to return a #N/A if Cell B was blank!
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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