How to convert a (-) number to (+) within a formula and add to TIME

zx6roo

New Member
Joined
Feb 17, 2006
Messages
15
In cell E4 I have the formula =IFERROR(A4+TIME(0,D4,0),("")).
Where A4 = time and D4 = a number. The formula adds the number to increase the time.

Problem:
Sometimes the number in column D is a negative but I still want to increase the time by that number, as in treat it like a positive.

So I changed the formula to this =IFERROR(A4+TIME(0,ABS(D4),0),("")).
It works however if I have -4 in the cell it only adds on 3 minutes instead of 4.

Can anyone help to make the -4 minutes actually add on as 4 minutes in time, not 3?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I tried your formula - it is working properly.
the problem might be somewhere else - not in the formula -- because ABS(D4) gets only the absolute value of the cell.
check your database...
 
Upvote 0
It is to. I changed the format on D4 to 2 decimal places and it's actually 3.7 so I can see why it only adds on 3 minutes.
It's a lookup field so I've put roundup on it and now it works correctly.
Thanks for being a second pair of eye LFKim2018 :)
 
Upvote 0
It is to. I changed the format on D4 to 2 decimal places and it's actually 3.7 so I can see why it only adds on 3 minutes.
It's a lookup field so I've put roundup on it and now it works correctly.
Thanks for being a second pair of eye LFKim2018 :)

glad to hear that..
 
Upvote 0

Forum statistics

Threads
1,215,324
Messages
6,124,250
Members
449,149
Latest member
mwdbActuary

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