Replace count totals

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
882
Hi all, i would like to write a vba code in order to replace the count total in col. "P" so that where employees working hours are more than 4:51 should count 1 and where is less to 4:50 should count 0.50 (half). In my below extract the "2065 Count Total" should be 19.50.
Thanking you in advance


ABCDEOP
1I.D.NameDateINOUTTotal Time
22065EMPL. 20651/11/20177:45:2017:43:319:58
32065EMPL. 20652/11/20177:46:0618:01:0710:15
42065EMPL. 20653/11/20177:57:0618:11:0610:14
52065EMPL. 20654/11/20177:46:3416:25:498:39
62065EMPL. 20656/11/20177:39:4511:30:203:91
72065EMPL. 20657/11/20177:45:1817:43:499:58
82065EMPL. 20658/11/20177:43:0717:26:029:43
92065EMPL. 206514/11/20177:43:5417:54:3510:11
102065EMPL. 206515/11/20178:11:1916:50:178:39
112065EMPL. 206516/11/20177:55:3017:29:329:34
122065EMPL. 206517/11/20177:43:3612:30:204:87
132065EMPL. 206520/11/20177:43:3117:04:099:21
142065EMPL. 206521/11/20177:40:0816:41:419:01
152065EMPL. 206522/11/20177:41:3517:20:329:39
162065EMPL. 206523/11/20177:39:2317:02:599:23
172065EMPL. 206524/11/20177:44:4016:45:479:01
182065EMPL. 206527/11/20177:43:0216:52:569:09
192065EMPL. 206528/11/20177:50:0617:39:089:49
202065EMPL. 206529/11/20177:42:0217:16:479:34
212065EMPL. 206530/11/20179:06:3617:30:128:24
222065 Count20
232065 Total
24
252088EMPL. 20887/11/20178:59:2217:47:468:48

<tbody>
</tbody>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Row 6 3:50 0.5
Row 12 4:46 0.5

2065 total sum 19

I'm using this formula

Code:
[COLOR=#0000cd]=IF(((E2-D2)*1440)>=291,1,0.5)[/COLOR]
 
Upvote 0
Hi Ihart,
Thank you for your support. The above formula works but can u explain me whats the mean of the numbers 1440 & 291? I know that the working monthly hours should be 173.33. However thanks once again for your help. Have a nice day
 
Upvote 0
Those numbers I use to convert time value to decimal value.
1440 is from minutes in 1 day (24 hours * 60 minutes )
291 is from 4:51 * 1440

Sorry about my english.
 
Upvote 0
Hi lhart, Thank you so much for explanation. Just i wanted to see the logic of the formula.
I understand you very well and so do not worry about English. I am so glad, that you help me and you resolve my problem. It was very kind of you.
All the best to you!
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,952
Members
448,535
Latest member
alrossman

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