Adding two columns

HCRSnyder

New Member
Joined
Sep 15, 2006
Messages
9
I have 2 columns that must be added. in some instances there are two negative values in both columns in others a positive and a negative. How do I get the columns to add correctly and display a negative value, if for example two negatives are being added.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
Could you explain your question a bit more? Excel does subtract two numbers (negative or postive) "correctly"

Gene, "The Mortgage Man", Klein
 

brian.wethington

Well-known Member
Joined
Jul 20, 2006
Messages
1,739

ADVERTISEMENT

I have 2 columns that must be added. in some instances there are two negative values in both columns in others a positive and a negative. How do I get the columns to add correctly and display a negative value, if for example two negatives are being added.

Oops -- wrote it wrong -- two columns that must be subtracted from one another

I find this to be somewhat confusing. Could you provide some examples of the entries and your desired results. Perhaps others can understand this.
 

HCRSnyder

New Member
Joined
Sep 15, 2006
Messages
9
Hey -- I figured it out. Since I have negative and positive numbers in any sort of combination in a column, I used this
=IF(AND(A2>0,B2>0),A2-B2,A2+B2)

That ensures that whether I subtract a negative from a negative or a positive from a negative or a negative from a positive, I get the correct value (Pos or Neg) in the answer field.

Maybe this will help others. Actually one of the IT people popped by my desk and helped me out.
 

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
Hey -- I figured it out. Since I have negative and positive numbers in any sort of combination in a column, I used this
=IF(AND(A2>0,B2>0),A2-B2,A2+B2)

That ensures that whether I subtract a negative from a negative or a positive from a negative or a negative from a positive, I get the correct value (Pos or Neg) in the answer field.

Maybe this will help others. Actually one of the IT people popped by my desk and helped me out.

Your formula is wrong. It will only hurt others. If, for example, you put
-5 in a2 and -1 in b2, then your formula gets -6 when it should get -4.

simply a2-b2 is correct and all you need.

Gene, "The Mortgage Man", Klein
 

Forum statistics

Threads
1,136,652
Messages
5,677,008
Members
419,668
Latest member
DharmaK

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
Top