dates formula

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
320
Office Version
  1. 2007
Hello I have a spreadsheet showing many dates approx 20,000 that show number of tests taken.

I would like to find out the number of tests taken in column A (dates) match that of all the dates in column B (dates) or were held 1 day later. Example Below dates would show as 2 dates matching, is there a piece of analysis to do this? any help would be appreciated, thank you

[TABLE="width: 198"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: right"]01/04/2018[/TD]
[TD="align: right"]01/04/2018 [/TD]
[/TR]
[TR]
[TD="align: right"]02/04/2018[/TD]
[TD="align: right"]03/04/2018[/TD]
[/TR]
[TR]
[TD="align: right"]01/05/2018[/TD]
[TD="align: right"]06/04/2018[/TD]
[/TR]
[TR]
[TD="align: right"]01/06/2018[/TD]
[TD="align: right"]
23/07/2018

[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
My date format is different than yours, but do you just mean something like this?


Book1
ABC
16/17/20186/18/2018Same or +/-1 Day
26/18/20186/19/2018Same or +/-1 Day
36/19/20186/20/2018Same or +/-1 Day
46/20/20186/21/2018Same or +/-1 Day
56/21/20186/21/2018Same or +/-1 Day
66/22/20186/22/2018Same or +/-1 Day
76/23/20186/23/2018Same or +/-1 Day
86/24/20187/2/2018Beyond 1 day
96/25/20187/3/2018Beyond 1 day
106/26/20187/4/2018Beyond 1 day
116/27/20187/5/2018Beyond 1 day
126/28/20187/6/2018Beyond 1 day
136/29/20187/7/2018Beyond 1 day
Sheet1
Cell Formulas
RangeFormula
C1=IF(OR(A1=B1,(ABS(A1-B1)=1)),"Same or +/-1 Day","Beyond 1 day")
 
Upvote 0
My date format is different than yours, but do you just mean something like this?

ABC
Same or +/-1 Day
Same or +/-1 Day
Same or +/-1 Day
Same or +/-1 Day
Same or +/-1 Day
Same or +/-1 Day
Same or +/-1 Day
Beyond 1 day
Beyond 1 day
Beyond 1 day
Beyond 1 day
Beyond 1 day
Beyond 1 day

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]6/17/2018[/TD]
[TD="align: right"]6/18/2018[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]6/18/2018[/TD]
[TD="align: right"]6/19/2018[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]6/19/2018[/TD]
[TD="align: right"]6/20/2018[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]6/20/2018[/TD]
[TD="align: right"]6/21/2018[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]6/21/2018[/TD]
[TD="align: right"]6/21/2018[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]6/22/2018[/TD]
[TD="align: right"]6/22/2018[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]6/23/2018[/TD]
[TD="align: right"]6/23/2018[/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]6/24/2018[/TD]
[TD="align: right"]7/2/2018[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]6/25/2018[/TD]
[TD="align: right"]7/3/2018[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"]6/26/2018[/TD]
[TD="align: right"]7/4/2018[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]6/27/2018[/TD]
[TD="align: right"]7/5/2018[/TD]

[TD="align: center"]12[/TD]
[TD="align: right"]6/28/2018[/TD]
[TD="align: right"]7/6/2018[/TD]

[TD="align: center"]13[/TD]
[TD="align: right"]6/29/2018[/TD]
[TD="align: right"]7/7/2018[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C1[/TH]
[TD="align: left"]=IF(OR(A1=B1,(ABS(A1-B1)=1)),"Same or +/-1 Day","Beyond 1 day")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Hello yes I was wondering if there was a piece of analysis that I can put into one cell to count all at the same time? thank you.
 
Upvote 0
Try the below formula in cell C1 then press Ctrl+Shift+Enter (CSE) to generate the curly braces (don't type the {}) … The formula will give you 1 or 0 which indicates if the date is matching date (1) or not (0)

{=MAX(IF(OR(A1=B:B,A1=B:B+1),1,0))}
 
Upvote 0
Try the below formula in cell C1 then press Ctrl+Shift+Enter (CSE) to generate the curly braces (don't type the {}) … The formula will give you 1 or 0 which indicates if the date is matching date (1) or not (0)

{=MAX(IF(OR(A1=B:B,A1=B:B+1),1,0))}

thank you both ways seem to work, thanks again
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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