Difference in date

vmjan02

Active Member
Joined
Aug 15, 2012
Messages
495
I have this records below

If the “PROJECT_NUMBER” is repeated AND “INCIDENT_CREATION_DATE” between the two incidents is less than 31 days then mark it as a "repeat"

I am confused as how shall I do it, as did countif as well to find the duplicate and then the diff in date but the records can be in any row.

INCIDENT_IDINCIDENT_CREATION_DATEPROJECT_NUMBERResult
13667296202-11-2019 09:51:01112298608Repeat
13667252202-11-2019 09:51:01112298601
13667258102-11-2019 09:51:01112298602
13667296902-12-2019 09:51:01112298608
13667299102-10-2019 09:51:01112298690
13667299902-11-2019 09:51:01112298661Repeat
13667281002-11-2019 09:51:01112298685
136672101002-15-2019 09:51:01112298661

<tbody>
</tbody>
 

Toadstool

Active Member
Joined
Mar 5, 2018
Messages
329
Change the $20 to whatever is your maximum row.

ABCD
1INCIDENT_IDINCIDENT_CREATION_DATEPROJECT_NUMBERResult
21366729622/11/2019 9:51112298608Repeat
31366725222/11/2019 9:51112298601
41366725812/11/2019 9:51112298602
51366729692/12/2019 9:51112298608
61366729912/10/2019 9:51112298690
71366729992/11/2019 9:51112298661Repeat
81366728102/11/2019 9:51112298685
913667210102/15/2019 9:51112298661

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D2
to
Dnnn
=IF(COUNTIF($C3:$C$20,C2)<1,"",IF(ABS(B2-INDEX($B3:$B$20,MATCH(C2,$C3:$C$20,0)))<31,"Repeat",""))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 

vmjan02

Active Member
Joined
Aug 15, 2012
Messages
495
Change the $20 to whatever is your maximum row.

ABCD
1INCIDENT_IDINCIDENT_CREATION_DATEPROJECT_NUMBERResult
21366729622/11/2019 9:51112298608Repeat
31366725222/11/2019 9:51112298601
41366725812/11/2019 9:51112298602
51366729692/12/2019 9:51112298608
61366729912/10/2019 9:51112298690
71366729992/11/2019 9:51112298661Repeat
81366728102/11/2019 9:51112298685
913667210102/15/2019 9:51112298661

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D2
to
Dnnn
=IF(COUNTIF($C3:$C$20,C2)<1,"",IF(ABS(B2-INDEX($B3:$B$20,MATCH(C2,$C3:$C$20,0)))<31,"Repeat",""))

<tbody>
</tbody>

<tbody>
</tbody>
It is working all correct.. Thanks
 

Forum statistics

Threads
1,081,992
Messages
5,362,601
Members
400,683
Latest member
LogChief

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top