#" 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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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)))
 
Upvote 0
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!
 
Upvote 0
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)))
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,220
Members
448,876
Latest member
Solitario

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
Back
Top