ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   trouble with subtracting cells and adding text... (https://www.excelbanter.com/excel-discussion-misc-queries/50372-trouble-subtracting-cells-adding-text.html)

traybuddy

trouble with subtracting cells and adding text...
 
A1=4278.39
Q12=4318.00

MY FORMULA IS...
=(Q12-A1)&"HRS"

IAM GETTING ...
39.6099999999997HRS

WHEN I SHOULD GET...
39.61HRS

IT ONLY HAPPENS WHEN I PUT THE... &"HRS" AT THE END OF THE FORMULA...

Faz


If you always have 2 decimal places, there should be no harm if you use
the ROUND function.


--
Faz
------------------------------------------------------------------------
Faz's Profile: http://www.excelforum.com/member.php...o&userid=27830
View this thread: http://www.excelforum.com/showthread...hreadid=476090


Roger Govier

Hi

I think you will need to use
=TEXT((Q12-A1),"0.00")&" HRS"

Regards

Roger Govier



traybuddy wrote:

A1=4278.39
Q12=4318.00

MY FORMULA IS...
=(Q12-A1)&"HRS"

IAM GETTING ...
39.6099999999997HRS

WHEN I SHOULD GET...
39.61HRS

IT ONLY HAPPENS WHEN I PUT THE... &"HRS" AT THE END OF THE FORMULA...



Cricketer

I agree with Roger except I think you need a /100 in the calculation.
Even if you put in 0.00000000% you still retain the integrity of the
calculation.
I tried several options including Concatenate and all but this method lose
the accuracy of the calculation. Anyone know why?
--
Cricketer


"traybuddy" wrote:

A1=4278.39
Q12=4318.00

MY FORMULA IS...
=(Q12-A1)&"HRS"

IAM GETTING ...
39.6099999999997HRS

WHEN I SHOULD GET...
39.61HRS

IT ONLY HAPPENS WHEN I PUT THE... &"HRS" AT THE END OF THE FORMULA...


Mangesh Yadav

Use:
=text(Q12-A1,"0.00")&" HRS"


Mangesh






"Cricketer" wrote in message
...
I agree with Roger except I think you need a /100 in the calculation.
Even if you put in 0.00000000% you still retain the integrity of the
calculation.
I tried several options including Concatenate and all but this method lose
the accuracy of the calculation. Anyone know why?
--
Cricketer


"traybuddy" wrote:

A1=4278.39
Q12=4318.00

MY FORMULA IS...
=(Q12-A1)&"HRS"

IAM GETTING ...
39.6099999999997HRS

WHEN I SHOULD GET...
39.61HRS

IT ONLY HAPPENS WHEN I PUT THE... &"HRS" AT THE END OF THE FORMULA...




Roger Govier

Hi

A better alternative than my first posting would be to format the cell.
FormatCellsNumberCustom and in the white pane type #,##.00 "HOURS"
You will then see 39.61 HOURS but the numeric value will still be
39.6099999999997

Regards

Roger Govier



Cricketer wrote:

I agree with Roger except I think you need a /100 in the calculation.
Even if you put in 0.00000000% you still retain the integrity of the
calculation.
I tried several options including Concatenate and all but this method lose
the accuracy of the calculation. Anyone know why?




All times are GMT +1. The time now is 12:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com