Date difference in range

jrevard

New Member
Joined
Mar 26, 2011
Messages
17
Hi,

I have several rows that contain two dates (in two columns). I would like to test each row to see if the dates differ by more than 7 days.

For example, A1:A10 could contain the "Start Date" and B1:B10 could contain the "End Date." Is there a formula I could put in C1 that would tell me how many of the End Dates are more than 7 days later than the Start Date? I would need this to work for varying row quantities (i.e. row quantity is unknown).

You guys are amazing and I look forward to any advice.

BTW I am trying to avoid VBA, but am comfortable with it if I must use it.

Thanks!

Justin Revard
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
This uses 2 dynamic ranges:
Start_Date: =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)
End_Date: =OFFSET(Start_Date,0,1)

Sheet1

*ABC
122/05/201501/06/20156
223/05/201528/05/2015*
324/05/201506/06/2015*
425/05/201526/05/2015*
526/05/201503/06/2015*
627/05/201508/06/2015*
728/05/201510/06/2015*
829/05/201506/06/2015*
930/05/201504/06/2015*
1031/05/201505/06/2015*

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:75px;"><col style="width:75px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
C1=SUMPRODUCT(--(End_Date>Start_Date+7))

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
Neil,

Thank you much for the quick and clean response. I am unfamiliar with the dynamic ranges you listed at the beginning of your post (and I notice they are not in the "Spreadsheet Formulas"). Where should I set up these dynamic ranges? In a module or the worksheet code perhaps? I am familiar with VBA, but only with forms and mostly simple code.

Thanks!

Justin Revard
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,449
Members
449,083
Latest member
Ava19

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