Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have been fooling around with a spreadsheet that allows me to enter my work
schedule and it calculates my approximate paycheck. The place I work at uses the 24 hour format which made life somewhat easier; but I can not help to think that there has got to be an easier way to work with time. Here is what I have done so far: =SUM((((((IF(AND(J7812,K78<12),(K78+24),K78))-(INT(IF(AND(J7812,K78<12),(K78+24),K78))))*100)/60)+(INT((IF(AND(J7812,K78<12),(K78+24),K78)))))-((((J78-(INT(J78)))*100)/60)+(INT(J78)))) This looks complicated and to a point it is at first glance; but here is what it is doing: First please note that I am entering times into the sheet in this format 10.3 & 16.45 are 10:30 am and 4:45 pm respectively. In the formula J78 is the start time and K78 is the quiting time. The first thing I needed to do (since I work a lot of overnight shifts) was compare the 2 cells to see if the quiting time was after midnight and if so add 24 hours to that time so the subtraction would work. This is done by the combination of 2 logics [ IF(AND(J7812,K78<12),(K78+24),K78) ]. Next I had to deal with the minutes portion of the cell (anything after the decimal point). This is done by seperating off the decimal by subtracting the whole number then multipling the decimal by 100 [ J78-(INT(J78)))*100) ]. This gives me the number of minutes but for payroll calculations I needed percent of an hour so this number is then divided by 60, followed by adding the whole hours back on [ J78-(INT(J78)))*100)/60)+(INT(J78) ]. Finally once this is completed with both cells, they can be subtracted from one another.... What I have here works but can anyone tell me an easier way? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to dealing with functions with 30+ variables? | Excel Worksheet Functions | |||
Dealing with +/- Values, Need Help | Excel Worksheet Functions | |||
Dealing with #N/A results | Excel Discussion (Misc queries) | |||
Dealing with errors | Excel Discussion (Misc queries) | |||
dealing with a projection | Charts and Charting in Excel |