Find out missing name or entity is in between months

James Clear

Board Regular
Joined
Jul 12, 2021
Messages
139
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
Platform
  1. Windows
How will I find out that Rahul name was present in Aug to Oct and then in Dec'21 , however same was missing in between Nov'21 month

Imagine there are thousands or lakhs of names and i have to find out such names with the months , how will i do it with excel formula ? pls assist

NameMonth
Rahul
Aug-21​
Rahul
Sep-21​
Rahul
Oct-21​
Atul
Nov-21​
Rahul
Dec-21​
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
with a pivottable you can count unique or the number of times a person appears in a month
Map1
ABCDEFGHIJKL
1NameMonthUnieke telling van NameKolomlabels
2RahulAug-21RijlabelsAug-21Sep-21Oct-21Nov-21Dec-21Eindtotaal
3RahulSep-21Atul11
4RahulOct-21Rahul11111
5AtulNov-21Eindtotaal111112
6RahulDec-21
7
8
9
Blad2
 
Upvote 0
with a pivottable you can count unique or the number of times a person appears in a month
Map1
ABCDEFGHIJKL
1NameMonthUnieke telling van NameKolomlabels
2RahulAug-21RijlabelsAug-21Sep-21Oct-21Nov-21Dec-21Eindtotaal
3RahulSep-21Atul11
4RahulOct-21Rahul11111
5AtulNov-21Eindtotaal111112
6RahulDec-21
7
8
9
Blad2
Thank you for your response , however I am looking for some formula which will help me to establish this output
 
Upvote 0
if B is sorted ascending, then in order in E2:N2 'll be oké
Cell Formulas
RangeFormula
E2:N2E2=IFERROR(TRANSPOSE(INDEX(Tabel1[[Month]:[Month]], MATCH(0, INDEX(COUNTIF($D$2:D2, Tabel1[[Month]:[Month]]), 0, 0), 0))), "")
D3:D12D3=IFERROR(INDEX(Tabel1[Name], MATCH(0, INDEX(COUNTIF($D$2:D2, Tabel1[Name]), 0, 0), 0)), "")
E3:N12E3=SUMPRODUCT((Tabel1[[Name]:[Name]]=$D3)*(Tabel1[[Month]:[Month]]=E$2))
 
Upvote 0
Solution
if B is sorted ascending, then in order in E2:N2 'll be oké
Cell Formulas
RangeFormula
E2:N2E2=IFERROR(TRANSPOSE(INDEX(Tabel1[[Month]:[Month]], MATCH(0, INDEX(COUNTIF($D$2:D2, Tabel1[[Month]:[Month]]), 0, 0), 0))), "")
D3:D12D3=IFERROR(INDEX(Tabel1[Name], MATCH(0, INDEX(COUNTIF($D$2:D2, Tabel1[Name]), 0, 0), 0)), "")
E3:N12E3=SUMPRODUCT((Tabel1[[Name]:[Name]]=$D3)*(Tabel1[[Month]:[Month]]=E$2))
Can you please simplify or define - Table[Month]: [Month] into ranges for my better understanding
 
Upvote 0
if B is sorted ascending, then in order in E2:N2 'll be oké
Cell Formulas
RangeFormula
E2:N2E2=IFERROR(TRANSPOSE(INDEX(Tabel1[[Month]:[Month]], MATCH(0, INDEX(COUNTIF($D$2:D2, Tabel1[[Month]:[Month]]), 0, 0), 0))), "")
D3:D12D3=IFERROR(INDEX(Tabel1[Name], MATCH(0, INDEX(COUNTIF($D$2:D2, Tabel1[Name]), 0, 0), 0)), "")
E3:N12E3=SUMPRODUCT((Tabel1[[Name]:[Name]]=$D3)*(Tabel1[[Month]:[Month]]=E$2))
Thanks Mate!!
 
Upvote 0
Cell Formulas
RangeFormula
E2:N2E2=IFERROR(TRANSPOSE(INDEX($B$2:$B$6, MATCH(0, INDEX(COUNTIF($D$2:D2, $B$2:$B$6), 0, 0), 0))), "")
D3:D12D3=IFERROR(INDEX($A$2:$A$6, MATCH(0, INDEX(COUNTIF($D$2:D2, $A$2:$A$6), 0, 0), 0)), "")
E3:N12E3=SUMPRODUCT((Blad2!$A$2:$A$6=$D3)*(Blad2!$B$2:$B$6=E$2))
 
Upvote 0
Cell Formulas
RangeFormula
E2:N2E2=IFERROR(TRANSPOSE(INDEX($B$2:$B$6, MATCH(0, INDEX(COUNTIF($D$2:D2, $B$2:$B$6), 0, 0), 0))), "")
D3:D12D3=IFERROR(INDEX($A$2:$A$6, MATCH(0, INDEX(COUNTIF($D$2:D2, $A$2:$A$6), 0, 0), 0)), "")
E3:N12E3=SUMPRODUCT((Blad2!$A$2:$A$6=$D3)*(Blad2!$B$2:$B$6=E$2))
I m having 2.5L rows which r taking a huge time to calculate it..I m applying only sumproduct formula n even if I apply it after that I will have to apply the logic to find out missing month
For example
Sequence comes out to be 10111 then I would require to count this whereas 11111 this is fine so how can I derive this by applying one formula? Pls assist
 
Upvote 0
the final goal is a list with only person & month missing or for every person a string like "1111101111000111100".
Is VBA (macro) allowed ?
 
Upvote 0
assumption all the dates in column B are the 1st of that month, otherwise i have to add an extra check
VBA Code:
Sub test()
     t = Timer
     Set dict = CreateObject("scripting.dictionary")
     dict.CompareMode = vbTextCompare

     a = Sheets("james").Range("A1").CurrentRegion.Value2       'read to an array
     mymin = Application.Min(Application.Index(a, 0, 2))        'smallest
     mymax = Application.Max(Application.Index(a, 0, 2))        'greatest
     Delta = WorksheetFunction.Round((mymax - mymin) / 30.5, 0) + 1     'number of months
     s0 = "'" & WorksheetFunction.Rept("0", Delta)              'startstring

     For i = 2 To UBound(a)
          If Not dict.exists(a(i, 1)) Then dict.Add a(i, 1), Array(a(i, 1), s0)     'does name already exist in dict, if not add
          it = dict(a(i, 1))                                    'item for that name
          j = WorksheetFunction.Round((a(i, 2) - mymin) / 30.5, 0) + 2     ' that month is character j in the string
          it(1) = Left(it(1), j - 1) & "1" & Mid(it(1), j + 1)  'replace that char with a "1"
          dict(a(i, 1)) = it                                    'write back to dict
     Next

     With Range("D1").Resize(dict.Count, 2)
          .Value = Application.Index(dict.items, 0, 0)
          .EntireColumn.AutoFit
     End With

     MsgBox "done in " & Format(Timer - t, "0.0s")
End Sub

Map1
ABCDEX
1NameMonthRahul11100000000000001
2Rahul1/08/21Atul00010000000000000
3Rahul1/09/21
4Rahul1/10/21
5Atul1/11/21
6Rahul1/12/22
7
8
9
james
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,938
Members
449,197
Latest member
k_bs

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