How to count duplicate as one?

feni1388

Board Regular
Joined
Feb 19, 2018
Messages
159
Office Version
  1. 2021
Platform
  1. Windows
Hello everyone...

I have the table as below.

The result that I want to achieve is the one in column B and C.
I want to know how many invoices numbers and how many banks are recorded for one customer code.
I tried using countifs or filter but I couldn't achieve the result that I expected.
Please help.

Thank you in advance.

Book1
ABCDEFGHI
1Customer CodeCount how many invoice numbersCount how many banksEntry dateInvoice No.Customer CodeBank Name
2PX129000212025/3/6168816PX129000A Bank
3PM487000122025/3/6168816PX129000A Bank
4PR6620002025/3/6168817PX129000A Bank
5PU2690002025/3/6168818PM487000A Bank
6MZS010002025/3/6168818PM487000B Bank
7PV7020002025/3/6168819PR662000A Bank
8PI5610002025/3/6168820PU269000B Bank
9PV2270002025/3/6168821MZS01000B Bank
10TBZ010002025/3/6168822PV702000C Bank
112025/3/6168823PI561000みずほ銀行
122025/3/6168824PV227000みずほ銀行
132025/3/6168825TBZ01000みずほ銀行
14
Sheet1
 
Is this what you are after?
I have assumed that each customer code in col A appears at least once in col H as per your sample.

25 03 07.xlsm
ABCDEFGHI
1Customer Codeinvoice numbersbanksEntry dateInvoice No.Customer CodeBank Name
2PX129000212025/3/6168816PX129000A Bank
3PM487000122025/3/6168816PX129000A Bank
4PR662000112025/3/6168817PX129000A Bank
5PU269000112025/3/6168818PM487000A Bank
6MZS01000112025/3/6168818PM487000B Bank
7PV702000112025/3/6168819PR662000A Bank
8PI561000112025/3/6168820PU269000B Bank
9PV227000112025/3/6168821MZS01000B Bank
10TBZ01000112025/3/6168822PV702000C Bank
112025/3/6168823PI561000みずほ銀行
122025/3/6168824PV227000みずほ銀行
132025/3/6168825TBZ01000みずほ銀行
Count
Cell Formulas
RangeFormula
B2:B10B2=ROWS(UNIQUE(FILTER(G$2:G$13,H$2:H$13=A2)))
C2:C10C2=ROWS(UNIQUE(FILTER(I2:I13,H$2:H$13=A2)))
 
Upvote 0
Solution
Is this what you are after?
I have assumed that each customer code in col A appears at least once in col H as per your sample.

25 03 07.xlsm
ABCDEFGHI
1Customer Codeinvoice numbersbanksEntry dateInvoice No.Customer CodeBank Name
2PX129000212025/3/6168816PX129000A Bank
3PM487000122025/3/6168816PX129000A Bank
4PR662000112025/3/6168817PX129000A Bank
5PU269000112025/3/6168818PM487000A Bank
6MZS01000112025/3/6168818PM487000B Bank
7PV702000112025/3/6168819PR662000A Bank
8PI561000112025/3/6168820PU269000B Bank
9PV227000112025/3/6168821MZS01000B Bank
10TBZ01000112025/3/6168822PV702000C Bank
112025/3/6168823PI561000みずほ銀行
122025/3/6168824PV227000みずほ銀行
132025/3/6168825TBZ01000みずほ銀行
Count
Cell Formulas
RangeFormula
B2:B10B2=ROWS(UNIQUE(FILTER(G$2:G$13,H$2:H$13=A2)))
C2:C10C2=ROWS(UNIQUE(FILTER(I2:I13,H$2:H$13=A2)))
Thank you so much Peter.
This is exactly what I'm after.
 
Upvote 0
You're welcome. Thanks for the confirmation. :)
 
Upvote 0

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