Subtract values from 2 different cells

jackt05

Board Regular
Joined
Feb 1, 2009
Messages
194
Hi all,

I have a simple chart of weight like below:
<!-- Please do not remove this header -->

Received RiceUsed RiceRemaining Rice
KGGramKGGramKGGrams
500200200300

<tbody>
</tbody>

The problem is that when I minus used Rice KG from Received Rice KG
it shows the answer as KG 300 & -100 Grams in The Remaining Rice cells,
But the answer should be KG 200 & 900 Grams.

How to use formula to get the right ans or is there any other method
of creating the table but I need to have different cells for KG and Grams.

Thanks for help
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi all,

I have a simple chart of weight like below:<!-- Please do not remove this header -->

Received Rice
Used Rice
Remaining Rice
KG
Gram
KG
Gram
KG
Grams
500
200
200
300

<TBODY>
</TBODY>

The problem is that when I minus used Rice KG from Received Rice KG
it shows the answer as KG 300 & -100 Grams in The Remaining Rice cells,
But the answer should be KG 200 & 900 Grams.

How to use formula to get the right ans or is there any other method
of creating the table but I need to have different cells for KG and Grams.

Thanks for help

How are the answers supposed to be 200KG and 900 Grams? The only way I could possibly see those being the answers is if you have a previous column that is Beginning Rice, which would then add Received and subtract used.
 
Upvote 0
I need to minus 2.3 kg from 5.2 kg where values
of KG and Grams are in different cells

So my answer is as follows
In cell of KG I put =500-200
and in cell of Gram I put =200-300

Received RiceUsed RiceRemaining Rice
KGGramsKGGramsKGGrams
500200200300300-100

<tbody>
</tbody>

I want it to be

Received RiceUsed RiceRemaining Rice
KGGramsKGGramsKGGrams
500200200300200900

<tbody>
</tbody>

as this is the right answer .
 
Upvote 0
The right answer is 299 KG & 900 Grams

And a way to get it is
Excel Workbook
ABCDEF
12Received RiceUsed RiceRemaining Rice
13KGGramsKGGramsKGGrams
14500200200300299900
Sheet1
Excel 2010
Cell Formulas
RangeFormula
E14=INT(A14+B14/1000-(C14+D14/1000))
F14=MOD(A14+B14/1000-(C14+D14/1000),1)*1000
 
Upvote 0
Ok, so these formulas are really not pretty, but it will get you the correct answer. Although I would point out that if you have KGs (i.e. 5.2), they should really be a single digit, not put as 500. Otherwise your grams should really be 5,200.

Remaining Rice KG: =TRUNC((((A1*1000)+B1)-((C1*1000)+D1))/1000)
Remaining Rice Grams: =(((((A1*1000)+B1)-((C1*1000)+D1))/1000)-(TRUNC((((A1*1000)+B1)-((C1*1000)+D1))/1000)))*1000

These will get your answers as KG 2 and Grams 900

If you want the KGs to show as 200 and not 2, add *100 to the end of the first formula as shown: =TRUNC((((A1*1000)+B1)-((C1*1000)+D1))/1000)*100
 
Upvote 0
Thanks a lot Alex but as the entry asked has to be 500 instead of 5.
but I got your point
Thanks again
 
Upvote 0
Ok, again not pretty for KGs: =TRUNC((((A1/100)+(B1/1000)-((C1/100)+(D1/1000)))))*100

And the one for grams seems to still be working (don't ask me how)
 
Upvote 0

Forum statistics

Threads
1,215,743
Messages
6,126,609
Members
449,321
Latest member
syzer

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