Extracting 2nd, 3rd (and so on) Values while ignoring Duplicates

LearnExcl

Board Regular
Joined
Mar 17, 2010
Messages
245
Office Version
  1. 2016
Platform
  1. Windows
Hello All, I need your assistance. See the tables below. So, I need to extract a unique list of vendor codes from the "DATA" below based on their area codes. Then, I need to sum the values under "Presence" corresponding to the vendor codes. The cell (B1) next to "Area Code" below is where I would enter the area code for which I would like to extract a unique list of vendor codes as well as their presence.The result of the area code SADF is illustrated below. I very much appreciate your time and effort in helping me out.
DATA
Sheet1
A B C
Area CodeVendor CodePresence
SADF1F0901
SADF1F0900
SADF1F0901
SADF2N0311
SADF9D0011
SADF2N0311
SADF9D0010
SADF1F0901
FADR1F0901
FADR1F0901
FADR4R0231
FADR1F0900
CAER4R0231
CAER5TA901
CAER5TA900
CAER2S0TY1

<tbody>
</tbody><colgroup><col><col><col></colgroup>

RESULT
Sheet 2
A B
Area Code:SADF
Vendor CodePresence
1F0903
2N0312
9D0011

<tbody>
</tbody><colgroup><col span="2"></colgroup>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
maybe something like....

Excel 2016 (Windows) 32 bit
ABCDEF
1Area CodeVendor CodePresenceArea Code:SADF
2SADF1F0901Vendor CodePresence
3SADF1F09001F0903
4SADF1F09012N0312
5SADF2N03119D0011
6SADF9D0011
7SADF2N0311
8SADF9D0010
9SADF1F0901
10FADR1F0901
11FADR1F0901
12FADR4R0231
13FADR1F0900
14CAER4R0231
15CAER5TA901
16CAER5TA900
17CAER2S0TY1

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
F3=IF(E3="","",SUMIFS(Sheet1!$C$2:$C$17,Sheet1!$A$2:$A$17,$F$1,Sheet1!$B$2:$B$17,E3))

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
E3{=IFERROR(INDEX(Sheet1!$B$2:$B$17,MATCH(0,IF(Sheet1!$A$2:$A$17=$F$1,COUNTIF($E$2:E2,Sheet1!$B$2:$B$17)),0)),"")}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
maybe something like....

Excel 2016 (Windows) 32 bit
A
B
C
D
E
F
1
Area Code
Vendor Code
Presence
Area Code:
SADF
2
SADF
1F090
1
Vendor Code
Presence
3
SADF
1F090
1F090
3
4
SADF
1F090
1
2N031
2
5
SADF
2N031
1
9D001
1
6
SADF
9D001
1
7
SADF
2N031
1
8
SADF
9D001
9
SADF
1F090
1
10
FADR
1F090
1
11
FADR
1F090
1
12
FADR
4R023
1
13
FADR
1F090
14
CAER
4R023
1
15
CAER
5TA90
1
16
CAER
5TA90
17
CAER
2S0TY
1

<tbody>
</tbody>
Sheet1


Worksheet Formulas
Cell
Formula
F3
=IF(E3="","",SUMIFS(Sheet1!$C$2:$C$17,Sheet1!$A$2:$A$17,$F$1,Sheet1!$B$2:$B$17,E3))

<tbody>
</tbody>

<tbody>
</tbody>


Array Formulas
Cell
Formula
E3
{=IFERROR(INDEX(Sheet1!$B$2:$B$17,MATCH(0,IF(Sheet1!$A$2:$A$17=$F$1,COUNTIF($E$2:E2,Sheet1!$B$2:$B$17)),0)),"")}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Thank you so much for your response. I need an additional huge favor though. In addition to the Area Code, if I wanted to control for another criterion, how would I go about doing that? For instance, under column D, there is a list of values reflecting access codes (ranging from 101 to 106). Can we insert "Access Code" in G1 and then enter 101 - 106 in cells G2 - G7 and control for them that way? Keep in mind, there may be a need to control for only 1 or up to 6 access codes at a time. Your help will be greatly appreciated.
 
Upvote 0
Hi Weasel. Would you be so kind as to explain the MATCH(0,IF(Sheet1!$A$2:$A$17=$F$1,COUNTIF($E$2:E2,Sheet1!$B$2:$B$17)),0) portion of the formula? I really appreciate your time.
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,270
Members
449,149
Latest member
mwdbActuary

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