ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Timesheet Counting problem (https://www.excelbanter.com/excel-programming/381574-excel-timesheet-counting-problem.html)

[email protected]

Excel Timesheet Counting problem
 
I have an excel timesheet that I want to do a simple task - count if an
employee ever works 7 days in a row.

Any Ideas?

Thanks,

Patrick


Corey

Excel Timesheet Counting problem
 
Depends on how you have each day set up.
If you have a daily cell value with hours in it you could use something
like:

If Range("A1:A7").value <"" then msgbox "The Employee has worked 7 days
straight."
' Where A1:A7 is the hrs worked for each day.

Corey....
wrote in message
ps.com...
I have an excel timesheet that I want to do a simple task - count if an
employee ever works 7 days in a row.

Any Ideas?

Thanks,

Patrick




Martin Fishlock

Excel Timesheet Counting problem
 
Patrick

This checks for series of 7 dates in a column:

=(2*MIN(B1:B7)+6)/2*7=SUM(B1:B7)

As in:
Row\Col A (Date) B (Ans)
1 25/1/2007 TRUE
2 26/1/2007 FALSE
3 27/1/2007 FALSE
4 28/1/2007 FALSE
5 29/1/2007 FALSE
6 30/1/2007 FALSE
7 31/1/2007 FALSE
8 FALSE
9 2/2/2007 TRUE
10 3/2/2007 FALSE
11 4/2/2007
12 5/2/2007
13 6/2/2007
14 7/2/2007
15 8/2/2007

You can then just do a
=if(countif(B:B,TRUE)0,"Worked more than 6 days in a row","")

Otherwise do the same in VBA.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


" wrote:

I have an excel timesheet that I want to do a simple task - count if an
employee ever works 7 days in a row.

Any Ideas?

Thanks,

Patrick



Tom Ogilvy

Excel Timesheet Counting problem
 
Range("A1:A7").value <""

raises an error for me.


--
Regards,
Tom Ogilvy


"Corey" wrote in message
...
Depends on how you have each day set up.
If you have a daily cell value with hours in it you could use something
like:

If Range("A1:A7").value <"" then msgbox "The Employee has worked 7 days
straight."
' Where A1:A7 is the hrs worked for each day.

Corey....
wrote in message
ps.com...
I have an excel timesheet that I want to do a simple task - count if an
employee ever works 7 days in a row.

Any Ideas?

Thanks,

Patrick






Chip Pearson

Excel Timesheet Counting problem
 
There are a number of ways to do this. How is your data laid out? How many
columns wide is the data? What does the data in each column mean? Are
non-worked days blanks or do they have a 0?

There are many way to lay out a timesheet, and a solution that applied to
one format may not work in another. You need to supply much more
information. Details count.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



wrote in message
ps.com...
I have an excel timesheet that I want to do a simple task - count if an
employee ever works 7 days in a row.

Any Ideas?

Thanks,

Patrick





All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com