Need help finding a result in a table (array? maybe simpler?)...

thp510

Board Regular
Joined
Oct 19, 2015
Messages
110
Office Version
  1. 365
Platform
  1. Windows
For Worksheet_1, I have the following table below across columns A to G and on rows 1 to 15 in excel. As you can see, it shows which person owns which segment (SMB, ENT, GROWTH, COM) based on their state. So for example the person that owns ENT in MT is Kelly (cell G3) or the person that owns SMB in NY is Lucas (cell C10). Multiple people can own the same state but not the same state and segment--that combination is unique (for example: both Phil and Jessica own CO, but Phil is an SMB person and Jessica is an ENT person).
ABCDEFG
1State#SMB
State#ENT
2 MT<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>3JasonID14Jake
3CO14PhilMT4Kelly
4NV16PhilCO51Jessica
5AZ12JasonHI5Jessica
6NJ2LukeNJ24Jessica
7WA14PhilNM14Tom
8
9State#SMBState#ENT
10NY20LucasAK5Pam
11IL22JohnTX31Jacob
12TX9LucasTN52Kyle
13NC10JohnDC3Toni
14SC5HarryIL14Kyle
15GA0SueMD2Toni

<tbody>
</tbody>

For Worksheet_2, I have the following excel sheet that shows each state and sales segment.
ABC
1StateSegment?
2COENT?
3GASMB?
4ILENT?
5COSMB?
6GASMB?

<tbody>
</tbody>

I need to find a formula in Column C that can search in Worksheet_1 based on the State in Column A and Segment in Column B in Worksheet_1. So for example, in cell C2 (CO ENT) the results should be Jessica. For cell C6, it would be Sue.Any advice on a formula I can use in column C?
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Maybe something like this.
Excel Workbook
ABCDEFG
1State#SMBState#ENT
2MT3JasonID14Jake
3CO14PhilMT4Kelly
4NV16PhilCO51Jessica
5AZ12JasonHI5Jessica
6NJ2LukeNJ24Jessica
7WA14PhilNM14Tom
8
9State#SMBState#ENT
10NY20LucasAK5Pam
11IL22JohnTX31Jacob
12TX9LucasTN52Kyle
13NC10JohnDC3Toni
14SC5HarryIL14Kyle
15GA0SueMD2Toni
16
17
18StateSegment
19COENTJessica
20GASMBSue
21ILENTKyle
22COSMBPhil
23GASMBSue
Sheet
 
Upvote 0
Thanks Ahoy. However, my original is a small sample size so I actually have more states and segments (more than just ENT and SMB). This means I would have to make additional nested IF statements (at least 7 more). Is there a better way than to make a long IF statement?
 
Last edited:
Upvote 0
Try:
This formula assumes that the State column will always be 2 columns back from the Segment column.
This is also an array formula that must be entered with CTRL-SHIFT-ENTER.
Drag formula down as needed.
Excel Workbook
ABCDEFG
1State#SMBState#ENT
2MT3JasonID14Jake
3CO14PhilMT4Kelly
4NV16PhilCO51Jessica
5AZ12JasonHI5Jessica
6NJ2LukeNJ24Jessica
7WA14PhilNM14Tom
8
9State#SMBState#ENT
10NY20LucasAK5Pam
11IL22JohnTX31Jacob
12TX9LucasTN52Kyle
13NC10JohnDC3Toni
14SC5HarryIL14Kyle
15GA0SueMD2Toni
16
17
18StateSegment
19COENTJessica
20GASMBSue
21ILENTKyle
22COSMBPhil
23GASMBSue
Sheet
 
Upvote 0
Perfect! Thank you so much!!!
Note that it does require that all instances of a segment heading are in the same column. That is, if the first "SMB" is in column C, then all "SMB" headings must be in column C, but that looks like it is the case for you anyway. :)
 
Upvote 0
You're welcome. Thanks for the feedback. As pointed out by Peter it also assumes that your header rows all be in the same order or the formula will fail.
 
Upvote 0

Forum statistics

Threads
1,214,419
Messages
6,119,389
Members
448,891
Latest member
tpierce

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