Dividing the number and setting the maximum in cells

Lamia

New member
Joined
Nov 2, 2013
Messages
1
Reaction score
0
Points
0
Hey everyone!
So basically, i need help with dividing the number. I have for example 20 hours(A1) which have to be divided into 8h + the rest. So, 8(B2)+8(B3)+4(B4) hours, and I have no idea how to come to that. I have tried few things, but I can only divide it by 8 and it doesn't go anywhere from that. I would be REALLY helpful if somebody would explain it to me, because i need to figure this out, urgently !

Thank you so much for your help guys (and girls )

Cheers, Lana
 

Canapone

New member
Joined
Oct 3, 2011
Messages
99
Reaction score
0
Points
0
Location
Italy
Excel Version(s)
Excel 2010
Hi,

sure there are better solutions than the following

In B1 and to the right

Code:
=IF(COLUMNS($A$1:A$1)>(INT(($A$1)/8)+(MOD($A$1,8)>0)),"",IF(COLUMNS($A$1:A$1)<=INT($A$1/8),8,MOD($A$1,8)))

or in B2 and down

Code:
=IF(ROWS($A$1:$A1)>(INT(($A$1)/8)+(MOD($A$1,8)>0)),"",IF(ROWS($A$1:$A1)<=INT($A$1/8),8,MOD($A$1,8)))


Regards
 
Last edited:
Top