# Thread: Dividing the number and setting the maximum in cells

1. ## Dividing the number and setting the maximum in cells

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  Reply With Quote

2. 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  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•