[Solved] Add Text With SUM Function

Discuss the spreadsheet application
Post Reply
lmandmac@aol.com
Posts: 3
Joined: Tue May 19, 2015 9:14 pm

[Solved] Add Text With SUM Function

Post by lmandmac@aol.com »

HI,

Can anyone help with an issue to add text such as, "Total Time:" into a SUM function that adds hours and minutes, Please?
Function is the SUM of two cells that have a value of 1:15 and 1:15 (One hour and fifteen minutes each). With no text added, the function [=SUM (F7;I7] shows the correct vale in the prescribed cell of 2:30. When the text is added in the function [=SUM(F7;I7)&"Total Time"] the data in the cell now reads 0.10416666666667

What is going on I've tried every combination of commands for hours to try and solve this issue, please help!!

Thank you,
LEM
Last edited by lmandmac@aol.com on Tue May 19, 2015 10:27 pm, edited 1 time in total.
OpenOffice 4.1 on Windows 7
FJCC
Moderator
Posts: 9279
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Add Text With SUM Funtion

Post by FJCC »

You are forcing the cell to contain text and Calc is showing the text representing the underlying value of 2 hours and 30 minutes. Time is measured in units of days, so 2:30 = 2.5/24 ~ 0.104167. To set the format of the sum you can use the text function

Code: Select all

=TEXT(SUM(F7;I7);"[HH]:MM") & " Total time"
I prefer to keep my numbers and text separate to the numbers can be used in calculations.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
gerard24
Volunteer
Posts: 958
Joined: Sat Oct 30, 2010 5:12 pm
Location: France

Re: Add Text With SUM Funtion

Post by gerard24 »

FJCC wrote:I prefer to keep my numbers and text separate to the numbers can be used in calculations.
Me too.

Just use the Sum:
=SUM(F7;I7)

and format the cell with

Code: Select all

[HH]:MM" Total time"
LibreOffice 6.4.5 on Windows 10
lmandmac@aol.com
Posts: 3
Joined: Tue May 19, 2015 9:14 pm

Re: Add Text With SUM Funtion

Post by lmandmac@aol.com »

Thank you for your quick reply!
This is somewhat cumbersome and complicated indeed, how would you recommend to get the same results in a more efficient manner?

Thank you!
OpenOffice 4.1 on Windows 7
lmandmac@aol.com
Posts: 3
Joined: Tue May 19, 2015 9:14 pm

Re: Add Text With SUM Funtion

Post by lmandmac@aol.com »

FJCC That works great! Just format cell with [HH] :MM" Total Time"

Thank you very much!!!!!
OpenOffice 4.1 on Windows 7
Post Reply