COUNTIF Unique values in adjaceme columns

Paul Naylor

Board Regular
Joined
Sep 2, 2016
Messages
98
Office Version
  1. 365
  2. 2003 or older
Platform
  1. Windows
  2. Mobile
  3. Web
Have a worksheet containing 2 columns.

Column A contains Order Numbers e.g. Ord123457 and Column B Names. Column A and B can contain duplicate values. Column C contains a list of all the unique names from column B

Formula on column D

Want a formula is column D , to lookup name in C against the name in B and count ONLY the unique order numbers column A registered against each of the names

ColumnA ColumnB ColumnC Column D
Ord12345 James James 2
Ord12345 James Bill 1
Ord23456 Bill Simon 3
Ord23456 James
Ord34567 Simon
Ord23456 James
Ord34567 Simon
Ord56789 Simon
Ord78912 Simon
 
Hi Fluff,

I've decided to simply copy and paste the info onto one sheet and run the formula against a single workbook although now realised that I'll need a formula for unique values based on additional Criteria columns C ( time order raiseddd/mm/yyyy hh:mm, such that only display unique value if column A and C are unique

Original formula for 1 unique value column A
=SUM(--(FREQUENCY(IF($B$2:$B$6796=J2,MATCH($A$2:$A$6796,$A$2:$A$6796,0)),ROW($A$2:$A$6796)-ROW($A$2)+1)>0))

Not sure how to adapt to contain 2 unique values ?
 

Attachments

  • 20210125_095229.jpg
    20210125_095229.jpg
    50.6 KB · Views: 5
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
How about
Excel Formula:
=SUM(--(FREQUENCY(IF($B$2:$B$6796=J2,MATCH($A$2:$A$6796&$C$2:$C$6796,$A$2:$A$6796&$C$2:$C$6796,0)),ROW($A$2:$A$6796)-ROW($A$2)+1)>0))
 
Upvote 0
How about
Excel Formula:
=SUM(--(FREQUENCY(IF($B$2:$B$6796=J2,MATCH($A$2:$A$6796&$C$2:$C$6796,$A$2:$A$6796&$C$2:$C$6796,0)),ROW($A$2:$A$6796)-ROW($A$2)+1)>0))
Hi Fluff, fantastic works a treat. Really appreciate you taking the time to help me out on more than one occasion. Always try to find a solution on the web before posting.

Once again massive thanks for all the help you've given me.

Regards,

Paul
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,777
Members
449,049
Latest member
greyangel23

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