excel /vba help - Substraction not working

Mallesh23

Well-known Member
Joined
Feb 4, 2009
Messages
976
Office Version
  1. 2010
Platform
  1. Windows
Hi Team,

I am trying to substract Column F value from column B.
giving me incorrect output. =F2--B2

When tried =D2--A2 gives me Correct output.

looking your help in excel formula or vba both ok. thanks

Below is a snapshot Column G gives wrong output, expected output shown in H2:H3.

Book7
ABCDEFGH
1 Outstanding Balance Bal as per SAP Sum Amt Difference Today's Balance Difference
2 5,317.59 307.26 -5317.59 - 307.26 614.52 Expected - 0 value in G2
3 5,000.00 4,000.00 -5000 - 5,000.00 9,000.00 Expected - 1000 in G3
4
5=D2--A2=F2--B2
Sheet1
Cell Formulas
RangeFormula
E2:E3E2=D2--A2
G2:G3G2=F2--B2



Thanks
mg
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi, you just need one minus sign in your formula i.e.

=F2-B2
 
Upvote 0
Hi FormR,

I want to use same formula in both Difference Column.

if I use single minus sign, in One Difference columns formula gives correct output.
in other Column it gives wrong output.


Thanks
mg
 
Upvote 0
Hi FormR,

Thanks for looking into my query. I used the formula suggested by you.
Column E is giving incorrect value.

Below is screenshot with formula in Column E and G.

Book7
ABCDEFG
1 Outstanding Balance Bal as per SAP Sum Amt Difference Today's Balance Difference
2 5,317.59 307.26 -5317.59 -10,635.18 307.26 -
3 5,000.00 4,000.00 -5000 -10,000.00 5,000.00 1,000.00
4
5=D2-A2=F2-B2
6
7Expected - 0 value in e2
8Expected - 1000 in E3
Sheet1
Cell Formulas
RangeFormula
E2:E3E2=D2-A2
G2:G3G2=F2-B2



Thanks
mg
 
Upvote 0
Can't you just use your existing formula in column E?
 
Upvote 0
Hi FormR,

I can, But I am creating vba macro to the end user, and my next course of action depend on minus values.
So needs same logic/formula for both the columns.



Thanks
mg
 
Upvote 0
But I am creating vba macro to the end user, and my next course of action depend on minus values.

It's not clear why that would make any difference but how about something like.

=A2-ABS(D2)
 
Upvote 0
Hi FormR,

Thanks for your help, it worked as expected. (y)

Thanks
mg
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

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