#" Days" ?/?" Hours"

Special-K

Board Regular
Joined
Apr 18, 2006
Messages
63
My results aren't displaying the way I had hoped ...
So, perhaps a kind-hearted Excel expert can guide me to a solution?

My cell formula reads:
=SUM(AE6/G111+AG6)

And the formatting of the cell is:
CUSTOM formatting
#" Days" ?/?" Hours"

Now this is how it's displaying:
Say the calculation AE6/G111= 1 .... and the fraction in cell AG6=0
Then my result will show:
1 [ SPACE ] Hours

BUT ... (with the same calculation) ... say the calculation AE6/G111= 1 ... and the fraction in cell AG6=1/2
Then my result will show:
1 Days 1/2 Hours

Do I not have something formatted properly?
How can I get the result to always read properly even if the result equals ZERO?
i.e.
0 DAYS 0 Hours
0 DAYS 3/4 Hours
1 DAYS 0 Hours

Cheers!

:confused:
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

agihcam

Well-known Member
Joined
Jan 16, 2006
Messages
1,624
there might be better way;
Code:
=IF(AG6=0,SUM(AE6/G111)&" "&"Days"&" "&AG6&" "&"Hrs",IF(SUM(AE6/G111)=0,SUM(AE6/G111)&" "&"Days"&" "&AG6&" "&"Hrs",SUM(AE6/G111+AG6)))
 

Special-K

Board Regular
Joined
Apr 18, 2006
Messages
63
It works ... but wow ... that's a fairly confusing formula to follow.

How would I adapt it to the formula below?
=SUM(AC12/G111-E107)

I tried ... but unsuccessfully.

Thank you for your help!
 

agihcam

Well-known Member
Joined
Jan 16, 2006
Messages
1,624
try;
Code:
=IF(E107=0,SUM(AC12/G111)&" "&"Days"&" "&E107&" "&"Hrs",IF(SUM(AC12/G111)=0,SUM(AC12/G111)&" "&"Days"&" "&E107&" "&"Hrs",SUM(AC12/G111-E107)))
 

Forum statistics

Threads
1,141,429
Messages
5,706,406
Members
421,447
Latest member
arthuro2021

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
Top