# How to calculate the difference between two values and display the result with a + or - sign

Options

Hi community! How can I calculate the difference between two values and display the result with a positive or negative sign depending on whether the difference is upward or downward?

For example, if I have two values: 5 and -2. I need the following result: -7.

And if I have: -5 and -2. I need the following result: 3.

Thank you so much!!

• ✭✭✭✭✭✭
edited 06/06/23
Options

I believe this will take care of it. Just subtract your first number from the second.

=[column 2]@row - [column 1]@row

-2 - 5 = -7

-2 - (-5) = 3

• Options

Im new to Samrtsheet but trying to do a basic house build budget. For each item row line item, I want 3 columns

1. Budget value \$ 2. Actual Cost \$ 3.The difference plus or minus between the 1 and 2 shows me whether I am over budget or under budget. I am struggling to make the formula to get for Collum 3 . I have looked around but can't find one that will give it to me correctly. Very glad of any help 🙂 Kind Regards Eddie
• Employee
Options

As long as the data in columns 1 and 2 are set as values (numbers) then you should simply be able to subtract one from the other! 🙂

If this hasn't helped, please post screen captures of your sheet (blocking out sensitive data) and identify how your data is being entered into columns 1 and 2.

Thanks!

Genevieve