Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cell Formatting

Hello and thanks in advance for any advice you can give.
I have cells A1 and B1 formatted for Time. I've used the formula =B1-A1 to give me the duration result in C1. Which it does...

Then I have the next column formatted to display the product of the duration multiplied by the hourly rate =C1*15 Which it does...

BUT it returns the value as time and I'd like it to display in dollars $$$. Of course I've selected the cell and pressed the dollar sign in the format bar.

Nothing changes. I've used the inspector and still nothing changes. I've attempted to add the ABS function to the end/beginning of the formula and still nothing changes. I'm stuck and need help. Does anyone have an answer to this problem..?
Please and thank you.

Posted on Mar 5, 2013 6:17 PM

Reply
Question marked as Best reply

Posted on Mar 5, 2013 6:24 PM

you should use the function dur2hours() to convert from a duration to a number. Then the multiplication will work as expected. You can get more details by opening the function browser using the menu item "View > Show Function Browser"

4 replies

Mar 5, 2013 10:16 PM in response to liquiddj

Hi dj,


You wrote: "BUT it returns the value as time and I'd like it to display in dollars $$$."


Actually, the formula returns a Duration value (as it should), not a Time value.


Suppose you spent three hours in the dentist's chair (3:00)

Then the dentist told you she'd need two more sessions (same duration) to complete the work.

The formula to calculate the total duration of your visits is 3 x 3:00, and the result is 9:00 (nine hours and zero minutes. The perceived duration is, of course, much greater.


Clicking the currency symbol in the format bar will set the cell to display a numeric value as currency. Since the value in the cell is a duration value, which can't be formatted as currency, the chosen format will be overruled, and a duration format applied.


As Wayne suggested, you need to use DUR2HOURS() to convert the duration amount to a number representing the number of hours (and fraction of hours) equivalent to the duration value shown.


There are two places in your example where this can be applied, depending whether you want to keep the duration display in C1.


If you'd be happy seeing a number in that then use =(DUR2HOURS(B1-A1) in cell C1, and =C1*15 in D1


If you'd like to keep the duration value displayed in C1, use =B1-A1 in cell C1, and =(DUR2HOURS(C1)*15 in D1.


Regards,

Barry


Regards,

Barry

Cell Formatting

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.