How to Count cells removing duplicate cells on certain date

mvkakaria

New Member
Joined
Aug 27, 2022
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

1661611900241.png

Suppose We have the above data for example, I want function for counting cells in O column on particular date. Say on 25th Aug 2022 total count in O column removing duplicates comes to 3. I want function for the same to be used in Excel.

Thankyou.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try this matrix formula (close with ctrl + shift + return).
Note that this formule makes your workbook slow with more data

Excel Formula:
=SUMPRODUCT(IFERROR(1/COUNTIFS(N1:N12,$N$1,O1:O12,O1:O12),0))
 
Upvote 0
Here also a UDF

VBA Code:
Function jec(rng As Range, strDate As Long) As Long
 Dim it
 With CreateObject("scripting.dictionary")
   For Each it In rng
     If it.Offset(, -1).Value = strDate Then .Item(it.Value) = Empty
   Next
   jec = .Count
 End With
End Function


ZOEKEN IN 3 KOLOMMEN (1).xlsm
NOPQR
125-8-2022aUDFFormula
225-8-2022b33
325-8-2022c
425-8-2022a
525-8-2022a
626-8-2022d
726-8-2022d
826-8-2022d
926-8-2022d
1026-8-2022e
1126-8-2022e
1226-8-2022f
Blad2
Cell Formulas
RangeFormula
Q2Q2=jec(O1:O12,N1)
R2R2=SUMPRODUCT(IFERROR(1/COUNTIFS(N1:N12,$N$1,O1:O12,O1:O12),0))
 
Upvote 0
Solution
Can you please share the excel file template of the above.

Thankyou
 
Upvote 0
This forum has no file sharing functionality. You just need to copy the formula. Enter the formula with ctrl+shft+return
 
Upvote 0
Here also a UDF

VBA Code:
Function jec(rng As Range, strDate As Long) As Long
 Dim it
 With CreateObject("scripting.dictionary")
   For Each it In rng
     If it.Offset(, -1).Value = strDate Then .Item(it.Value) = Empty
   Next
   jec = .Count
 End With
End Function


ZOEKEN IN 3 KOLOMMEN (1).xlsm
NOPQR
125-8-2022aUDFFormula
225-8-2022b33
325-8-2022c
425-8-2022a
525-8-2022a
626-8-2022d
726-8-2022d
826-8-2022d
926-8-2022d
1026-8-2022e
1126-8-2022e
1226-8-2022f
Blad2
Cell Formulas
RangeFormula
Q2Q2=jec(O1:O12,N1)
R2R2=SUMPRODUCT(IFERROR(1/COUNTIFS(N1:N12,$N$1,O1:O12,O1:O12),0))
Thanyou so much, solved the problem.
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

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