How to capture date fields based on a condition

kicassrt

New Member
Joined
Feb 18, 2013
Messages
9
Hey guys

I have import data that will come in as dates. I am looking to get the dates noted in a column, or multiple columns if there are many breaks in the date. When I mean breaks I mean
in the example below the dates are consistent (B1 is 1 day earlier then A2) this continues until B3 and A4. I want to grab that period or in this example its 08/01/2011-08/30/2011 and note that in a column then continue on.. If there is no other breaks it will read 10/31/2011- whatever ending B column of data. These data columns won't be exactly the same on any given import into excel so they could have no breaks and be simply A1 - B40 or it could have a lot of breaks and I want to capture that in another worksheet with the breaks (followed by a simple math of the days total of that break period )... I think I need a Do Until loop but my mind is getting loopy trying to figure this out a I need to stop on a break (if there is one) get the data, then continue capturing any breaks until there is no data in column B:confused:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Column A (start date)[/TD]
[TD]Column B (end date)[/TD]
[/TR]
[TR]
[TD]08/01/2011[/TD]
[TD]08/05/2011[/TD]
[/TR]
[TR]
[TD]08/06/2011[/TD]
[TD]08/20/2011[/TD]
[/TR]
[TR]
[TD]08/21/2011[/TD]
[TD]08/30/2011[/TD]
[/TR]
[TR]
[TD]10/01/2011[/TD]
[TD]10/30/2011[/TD]
[/TR]
[TR]
[TD]10/31/2011[/TD]
[TD]11/10/2011[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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