Count cells between occurrences of specific values

Lingim

New Member
Joined
Sep 4, 2014
Messages
3
Hell All,
I am doing some work on time sheets in excel and am having trouble coming up with a formula (or VBA) to determine the number of days between leave days; and the number of working days in a row.
in the below pic days off are "L", working days are of a variety of values. Each row is a fortnight but would like formula to be able to continue through each row downward.
hope someone can assist in pointing me in the right direction.
Cheers

SundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturday
DDDDDDLLLDDDLL
D2D2D2D2D2D2D2D2LLLLLD
DDLLLLLDDDDDDD
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Welcome. In your example, what answer(s) are you looking for?
 
Upvote 0
Hi Kweaver,
I didn't explain my self very well, sorry.
Am looking for a result such as workdays=5, leave=3,workdays=3,leave=2,workdays=8,leave=5, workdays=3,leave =5, workdays=7, etc..
in the example above the roster has 3 lines, but will be working on rosters of 20 lines plus.
the format of the result is not critical, i just need to be able to analyse the roster pattern to ensure compliance with business rules.
Result could be a VBA solution that i can run, no need for real time. Result could even be a separate .csv file. I just can't seem to come up with a solution that works.

Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,046
Members
449,063
Latest member
ak94

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