How to consider duplicate cell/number as one in VLOOKUP

Abuahmed

New Member
Joined
Nov 11, 2017
Messages
2
DATA

PO NOVendor No.Vendor NameAccount US$ Posting DateCOMMENTS
4528012031ABC COMPANY11002002 200.00 31-12-2016NO INVOICE
4528012031ABC COMPANY11002003 350.00 31-12-2016NO INVOICE
4528012031ABC COMPANY11002004 300.00 31-12-2016NO INVOICE
4528012031ABC COMPANY11002005 270.00 31-12-2016NO INVOICE
4523012008XYZ COMPANY11002090 2,500.00 31-12-2015WRONG ADDRESS
4523312008XYZ COMPANY11002090 3,000.00 31-12-2015WRONG ADDRESS
4526312031GOOD LLC11002090 500.00 31-12-2015NO INVOICE
4527511042LINE COMPANY11002090 300.00 31-12-2015WRONG AMOUNT
4527511042LINE COMPANY11002091 400.00 31-12-2015WRONG AMOUNT
4543511288JK LLC11002090 700.00 31-12-2015NO INVOICE
4548010038LOGIC COMPANY11002090 80.00 31-12-2016CLEAN INVOICE
4548010038LOGIC COMPANY11002080 50.00 31-12-2016CLEAN INVOICE
4548010038LOGIC COMPANY11002090 30.00 31-12-2016CLEAN INVOICE

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

When I run vlookup I am getting the below result: It count NO PO including duplicate numbers:

COMMENTSCount of PO NOSum of US$
CLEAN INVOICE3160
NO INVOICE62320
WRONG ADDRESS25500
WRONG AMOUNT2700
Grand Total138680

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


I do not want counting duplicate just consider as one. like below example:
how can I get the below result in the vlookup please.
COMMENTSCount of PO NOSum of US$
CLEAN INVOICE1160
NO INVOICE32320
WRONG ADDRESS25500
WRONG AMOUNT1700
Grand Total78680

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

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,

B19 =SUMPRODUCT(--1/COUNTIF($A$2:$A$14,$A$2:$A$14),--($G$2:$G$14=A19))

C19 =SUMPRODUCT(--($G$2:$G$14=A19),$E$2:$E$14)

ABCDEFG
1PO NOVendor No.Vendor NameAccountUS$Posting DateCOMMENTS
24528012031ABC COMPANY1100200220031/12/16NO INVOICE
34528012031ABC COMPANY1100200335031/12/16NO INVOICE
44528012031ABC COMPANY1100200430031/12/16NO INVOICE
54528012031ABC COMPANY1100200527031/12/16NO INVOICE
64523012008XYZ COMPANY110020902,500.0031/12/15WRONG ADDRESS
74523312008XYZ COMPANY110020903,000.0031/12/15WRONG ADDRESS
84526312031GOOD LLC1100209050031/12/15NO INVOICE
94527511042LINE COMPANY1100209030031/12/15WRONG AMOUNT
104527511042LINE COMPANY1100209140031/12/15WRONG AMOUNT
114543511288JK LLC1100209070031/12/15NO INVOICE
124548010038LOGIC COMPANY110020908031/12/16CLEAN INVOICE
134548010038LOGIC COMPANY110020805031/12/16CLEAN INVOICE
144548010038LOGIC COMPANY110020903031/12/16CLEAN INVOICE
15
16
17
18COMMENTSCount of PO NOSum of US$
19CLEAN INVOICE1160
20NO INVOICE32320
21WRONG ADDRESS25500
22WRONG AMOUNT1700
23Grand Total8680

<tbody>
</tbody>
 
Last edited:
Upvote 0
Row\Col
A​
B​
C​
D​
E​
F​
G​
J​
K​
L​
1​
PO NOVendor No.Vendor NameAccountUS$ Posting DateCOMMENTS COMMENTS Count of PO NO Sum of US$
2​
45280
12031
ABC COMPANY
11002002
200
12/31/2016
NO INVOICE CLEAN INVOICE
1
160
3​
45280
12031
ABC COMPANY
11002003
350
12/31/2016
NO INVOICE NO INVOICE
3
2320
4​
45280
12031
ABC COMPANY
11002004
300
12/31/2016
NO INVOICE WRONG ADDRESS
2
5500
5​
45280
12031
ABC COMPANY
11002005
270
12/31/2016
NO INVOICE WRONG AMOUNT
1
700
6​
45230
12008
XYZ COMPANY
11002090
2,500.00
12/31/2015
WRONG ADDRESS
7​
45233
12008
XYZ COMPANY
11002090
3,000.00
12/31/2015
WRONG ADDRESS
8​
45263
12031
GOOD LLC
11002090
500
12/31/2015
NO INVOICE
9​
45275
11042
LINE COMPANY
11002090
300
12/31/2015
WRONG AMOUNT
10​
45275
11042
LINE COMPANY
11002091
400
12/31/2015
WRONG AMOUNT
11​
45435
11288
JK LLC
11002090
700
12/31/2015
NO INVOICE
12​
45480
10038
LOGIC COMPANY
11002090
80
12/31/2016
CLEAN INVOICE
13​
45480
10038
LOGIC COMPANY
11002080
50
12/31/2016
CLEAN INVOICE
14​
45480
10038
LOGIC COMPANY
11002090
30
12/31/2016
CLEAN INVOICE

In K2 control+shift+enter, not just enter, and copy down:

=SUM(IF(FREQUENCY(IF($G$2:$G$14=$J2,$A$2:$A$14),$A$2:$A$14),1))

In L2 just enter and copy down:

=SUMIFS($E$2:$E$14,$G$2:$G$14,$J2)

This set up should be a tad faster.
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

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