dates formula

xxsalahxx

Active Member
Joined
Jun 25, 2011
Messages
316
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

01/04/201801/04/2018
02/04/201803/04/2018
01/05/201806/04/2018
01/06/2018
23/07/2018


<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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
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

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

Worksheet Formulas
CellFormula
C1=IF(OR(A1=B1,(ABS(A1-B1)=1)),"Same or +/-1 Day","Beyond 1 day")

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

<tbody>
</tbody>

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,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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