Concatenate cells with different formatting...

RobbieC

Active Member
Joined
Dec 14, 2016
Messages
376
Office Version
  1. 2010
Platform
  1. Windows
Hi there, I have 2 cells with values. One is formatted as 'general' (A1) and one with a 'custom' format - h"hrs" mm"m" (B1)

I need to concatenate the 2 together in (C1)

The value in (A1) is: "Time spent running: "
The Value in (B1) is: 0.0347, which after the formatting shows '0hrs 50m'

I was hoping to get a result in (C1) as: "Time spent running: 0hrs 50m"

but the actual result is "Time spent running: 0.0347"

I have found that if I change the formula in C1 to:

Code:
CONCATENATE(A1," - ",TEXT(B1, "h:mm"))

the result is "Time spent running: 0:50", but I really want "Time spent running: 0hrs 50m"...

Is there a way to combine my 2 cells, yet retain the formatting of my hours and mins?

If you can point me in the right direction, I'd be really grateful

Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
As per usual Rick, you are the man! Thank you :)
 
Upvote 0
You actually are concatenating the value " - " inbetween so your output would include that. Not sure why you included it but did not mention it as part of the output result. Anyways you can do this...

Code:
="Time spent running: " & ROUNDDOWN(0.0347*24,0) & "hrs " & ROUND(0.0347*24-ROUNDDOWN(0.0347*24,0)*60,0) & "m"

which in your sheet would look like

Code:
=A1 & ROUNDDOWN(B1*24,0) & "hrs " & ROUND(B1*24-ROUNDDOWN(B1*24,0)*60,0) & "m"

i wrote those here so double check for typos
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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