Vlookup formula with Offset

bill_s1416

Board Regular
Joined
Feb 12, 2003
Messages
103
Sheet A ('Customers Alignment'):
--------------------------------------
column A- name of sales representative
column B - customer ID
(Not sorted in any particular order. So, a sales rep could be listed in row 5, 27, etc)

Sheet B ('Sales Rep Lists'):
------------------------------
cell 'A1' drop-down selection of sales rep name.
I need below that to list the customers of the sales rep selected in cell A1 in a continuous list, even though the data is randomly sorted on sheet A. Can this be done with a single formula (maybe with an Vlookup and/or an Offset?)
:unsure:
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,697
Try the following formula which needs to be confirmed with CONTROL+SHIFT+ENTER, not just ENTER...

'Sales Rep Lists'!B1, copied down:

Code:
=IF(ROWS(B$1:B1)<=COUNTIF('Customers Alignment'!$A$1:$A$100,$A$1),INDEX('Customers Alignment'!$B$1:$B$100,SMALL(IF('Customers Alignment'!$A$1:$A$100=$A$1,ROW('Customers Alignment'!$A$1:$A$100)-ROW('Customers Alignment'!$A$1)+1),ROWS(B$1:B1))),"")

Adjust the ranges accordingly.

Hope this helps!
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
49,439
Office Version
  1. 365
Platform
  1. Windows
Sheet A ('Customers Alignment'):
--------------------------------------
column A- name of sales representative
column B - customer ID
(Not sorted in any particular order. So, a sales rep could be listed in row 5, 27, etc)

Sheet B ('Sales Rep Lists'):
------------------------------
cell 'A1' drop-down selection of sales rep name.
I need below that to list the customers of the sales rep selected in cell A1 in a continuous list, even though the data is randomly sorted on sheet A. Can this be done with a single formula (maybe with an Vlookup and/or an Offset?)
:unsure:
Could you just use AutoFilter on the data in the original 'Customers Alignment' sheet? Using the AutoFilter on column A would give you the list.
 

Forum statistics

Threads
1,136,588
Messages
5,676,675
Members
419,643
Latest member
ishanalikhan

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
Top