List of Dates with Duplicate Values

MrDB4Excel

Active Member
Joined
Jan 29, 2004
Messages
334
Office Version
  1. 2013
Platform
  1. Windows
All figures in this Xl2bb Mini Sheet are bogus and only shown to give value to the sheet.
To carry on from my posted thread yesterday, 4 December 2022, I am attempting to create a list of dates, which have the same count number, and yet are relevant to a specific number in the Main Rate column.
In other words, with cell O8 showing the number 2, and with cell C8 showing 21.578, then the sought-after formula would provide a list of the two dates associated with the rate of 21.578.
Similarly, with cell O12 showing the number 3, and with cell C12 showing 23.763, then the sought-after formula would provide a list of the two dates associated with the rate of 23.763.
This Xl2bb Mini Sheet is but a fraction example of another sheet, which will be updated when I learn of some, sought-after formula that will do what I have been searching about.
It may not be necessary to pay any attention to the formulas you find in the Xl2bb Mini Sheet because those are my feeble attempts and may not be what is needed anyway.
The column titled “Lookup Number” is only a list of possible duplicate counts that could exist in the much larger Excel file from which these examples have been taken.
And, if this is not enough then is it possible to infill dates into the relevant cells in the column titled “Extra Dates Per Specific Rate” or is this a difficult venture due to the fact there will be more than one rate that has one or more duplicates yet simultaneously different dates. In other words, the rate 21.688, of which there are two, have dates different than the dates shown for the rate 21.578.
Please help and if something isn’t clear let me know and I will do my best to clarify.
Any help is much appreciated.

ReturnDatesMatchCells.xlsx
ABCDEFGHIJKLMNOPQRSTU
1TimeDateMain RateSupport RateExtra Dates Per Specific Rate212323D Col CountCOUNTDuplicate CountLookup Number
2Min ððð62,341.302,900$B$2321
3Max ððð68,912.703,100
49:26:09Fri-01 April 202221.57421.57862,564.6012,90011Wed-06 April 2022Fri-01 April 202221.5742Fri-01 April 2022
50.0040 3
617:47:32Mon-04 April 202221.49721.50162,341.3012,9001121.4974
70.0040 5
88:11:17Wed-06 April 202221.57821.58262,576.2012,9002221.578
90.0040 
108:06:34Thu-07 April 202221.57821.58262,576.2012,9002221.578
110.0040 
1212:24:17Fri-25 November 202223.76323.76768,912.7012,9003323.763
130.0040 
149:19:06Sat-26 November 202223.76323.76768,912.7012,9003323.763
150.0040 
167:21:11Sun-27 November 202223.76323.76768,912.7012,9003323.763
170.0040 
1815:05:29Fri-07 April 202321.67921.68467,204.9013,1001121.679
190.0050 
208:29:10Sat-08 April 202321.68821.69367,232.8013,1002221.688
210.0050 
2217:47:39Sun-09 April 202321.68821.69367,232.8013,1002221.688
230.0050
Test1
Cell Formulas
RangeFormula
J1J1=EXTRACTNUMBERS(M2,TRUE)
K1K1=SUM(J1+2)
L1L1=EXTRACTNUMBERS(K1)
L2L2=ADDRESS(L1,2)
M2M2=COUNTA(D:D)
F2F2=MIN($E$4:$E$17)
F3F3=MAX($E$4:$E$17)
E4,E22,E20,E18,E16,E14,E12,E10,E8,E6E4=IFERROR(IF(SUM(C4*H4)=0,"",(SUM(C4*H4))),"")
H4,H22,H20,H18,H16,H14,H12,H10,H8,H6H4=IF(YEAR(B4)=2022,$H$2,IF(YEAR(B4)=2023,$H$3,""))
N4,N22,N20,N18,N16,N14,N12,N10,N8,N6N4=SUM(IF($C$4:$C$22=C4,1,0))
O4,O22,O20,O18,O16,O14,O12,O10,O8,O6O4=COUNTIF($C$4:$C$22,C4)
P4P4=XLOOKUP(2,O4:O22,B4:B22,0)
R4,S4:S22R4=IF(B4=0,"",B4)
U4U4=INDEX($B$4:$B$26, SMALL(IF(COUNTIF($T$4, $O$4:$O$22)*COUNTIF($R$4, $B$4:$B$26), ROW($B$4:$O$22)-MIN(ROW($B$4:$O$22))+1), ROW(A1)), COLUMN(A1))
G5:G23G5=MOD(ROWS(G$2:G3),2)
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:D23Expression=$G4=0textNO
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
If you're just looking to get the dates where there's duplicates, wouldn't a simple index match do?
 
Upvote 0
I tried, believe me, I tried to get this to work and it does not. But I have long ago given up on getting this to work because I decided it was not that important. But if someone comes up with a better working solution I am all ears.
 
Upvote 0
If you're still interested in troubeshooting then I have some questions. If you've given up that's OK too. Not all solutions are worth the time investment.

O8 showing the number 2, and with cell C8 showing 21.578, then the sought-after formula would provide a list of the two dates associated with the rate of 21.578.
Similarly, with cell O12 showing the number 3, and with cell C12 showing 23.763, then the sought-after formula would provide a list of the two dates associated with the rate of 23.763.
What does column O have to do with the results of the lookup?

My main trouble is I don't understand in plain terms what your inputs and outputs are.

for example,
Inputs: Column C has rates that are duplicates.
Output, on each row, columns P, Q, R, S, etc. Where the rates are duplicates, look up the date in column B and return the duplicate dates.
 
Upvote 0
MCLIFTO8, you hit the nail on the head. Everything past column C in my original post is totally useless and not needed. So the whole point of what I am after pertains to columns B & C.
All parts of my original post beyond column C I originally thought were relevant. Not so. Those were my feeble attempts at resolving the issue and so I thought were important.
Having had sufficient time since this original post I came to the conclusion pretty much as you have indicated and have tried in vain before your first reply yesterday along with your first reply at a resolution and keep hitting my head on that proverbial brick wall.
In short, I only need to get all dates relevant to any of those numbers in column C that are duplicates.
 
Upvote 0
MCLIFTO8, you hit the nail on the head. Everything past column C in my original post is totally useless and not needed. So the whole point of what I am after pertains to columns B & C.
In short, I only need to get all dates relevant to any of those numbers in column C that are duplicates.

Ok, this is simple. I've detailed the steps exactly because we're on a forum and can't talk over the phone.

Find nth match based on lookup
  • In excel 365 you can use filter to get duplicates quite easily.
    You've listed Excel 2013 on your bio so I'm going with a different formula.
  • In older versions of excel X lookup supports the first and last instance of a value. If your duplicates are limited to 2 or less a simple xlookup will suffice.
  • Also in older versions of excel There are various "get nth match with vlookup" type formulas that use helper columns as well.
  • Finally in older versions of excel There are "index match" lookups that do not require helper columns.
    We will go with this one.
Here's the solution I modified from ExcelJet and mentioned previously in the thread.
exceljet.net/formulas/get-nth-match-with-index-match

Original/ template formula
Important! Press Control + Shift + Enter when entering the formula.

Excel Formula:
=INDEX(return_array,SMALL(IF(lookup_array=lookup_value,(lookup_array)-ROW(INDEX(lookup_array,1,1))+1),nth_match))

Your formula
  1. Put this in P4 with ctrl + shift + enter.
    Excel Formula:
    =INDEX($B:$B,SMALL(IF($C:$C=$C4,ROW($C:$C)-ROW(INDEX($C:$C,1,1))+1),1))
    1670903277012.png



  2. select P4:P5, drag down your formula and it should insert your formula skipping a row as it goes down.
    1670903344760.png


  3. Then select all your formulas, drag them right 2-3 columns depending on how many duplicates you need to check.
    1670903400122.png



  4. Then highlight the second column of formuas, ctrl-h, find +1),1)) replace with +1),2)). for the third column replace +1),1)) with +1),3)), etc, etc.
    It has to be highlighted, otherwise you will destroy all the formulas not just the column you're working on.
    1670903814836.png
You should end up with this.....
1670903940953.png


You can delete or modify columns A and D:O, they aren't used in the formula.
 
Upvote 0
Worked very well, thank you for going above and beyond.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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