Jaafar Tribak
Well-known Member
- Joined
- Dec 5, 2002
- Messages
- 9,797
- Office Version
- 2016
- Platform
- Windows
Hi all,
I have the following :
______A____ ____B___________ C
1___Time In______Time Out______Total Hours
2 ____10:00______14:00__________04:00
3 ____23:30______01:45__________02:15
4
5 ____13:00______14:30__________01:30
The Formula I have in Column C to calculate the total hours is : (filled down the rows below)
=IF(AND(A1="",B1=""),"",IF(AND(A1<>"",B1<>""),(1-A1)+B1,IF(A1>NOW(),0,(1-A1)+NOW())))
Then in cell H1, I am trying to get the sum of total hours as follows :
{=IF(C1:C4<>"",SUM(HOUR(C1:C4)+MINUTE(C1:C4)/60),0)} (Array Formula)
Cell H1 containing the array formula is is Number-formatted as General.
The array formula works well except if the cells in row 4 (ie both cells A4 AND B4) are blanks
In other words, If row 4 is blank as in the above table then the formula returns #VALUE ! error as it is trying to sum blank cells.
Can someone solve this without using a helping column ?
Thank you.
I have the following :
______A____ ____B___________ C
1___Time In______Time Out______Total Hours
2 ____10:00______14:00__________04:00
3 ____23:30______01:45__________02:15
4
5 ____13:00______14:30__________01:30
The Formula I have in Column C to calculate the total hours is : (filled down the rows below)
=IF(AND(A1="",B1=""),"",IF(AND(A1<>"",B1<>""),(1-A1)+B1,IF(A1>NOW(),0,(1-A1)+NOW())))
Then in cell H1, I am trying to get the sum of total hours as follows :
{=IF(C1:C4<>"",SUM(HOUR(C1:C4)+MINUTE(C1:C4)/60),0)} (Array Formula)
Cell H1 containing the array formula is is Number-formatted as General.
The array formula works well except if the cells in row 4 (ie both cells A4 AND B4) are blanks
In other words, If row 4 is blank as in the above table then the formula returns #VALUE ! error as it is trying to sum blank cells.
Can someone solve this without using a helping column ?
Thank you.
Last edited: