Difference (either positive or negative) between two numbers

0

I am a teacher who is creating a Google sheet for students. I will be recording monthly scores in individual cells. I need a formula that would show either a gain or loss when a student's score changes from one month to the next.

For example, if a score in cell C14 on 10/1 was 720 and a score in cell D15 on 11/1 was 700, I would need a separate cell (that shows gains and losses) to say "-20" because this student's score decreased by 20 points.

However, if a score in cell C14 on 10/1 was 720 and and a score in cell D15 on 11/1 was 750, I would need the cell (that shows gains and loses) to say either "30" or "+30"

Can anyone help?

June

Posted 2019-08-29T09:20:31.403

Reputation: 1

1Just substract one value from the other with a reference? 700-720 is -20, 750-720 is 30. So I don't really get what would be the problem? – Seth – 2019-08-29T09:31:22.053

What formula are you using? If I use the =A1-A2 formula, and the score on 9/1 is 720 and the score on 10/1 is 700, the result shows as 20, which is a positive number. I would need it to show as -20. Please remember I'm not a tech guru! – June – 2019-08-29T09:59:02.083

Yes it is, because you're comparing the last week to this week (assuming A1 is 9/1) and last week his score was better. If you want to compare this week to last week you need to subtract last weeks score from this weeks score. So it would be A2-A1 and later on probably A3-A2 and so on. – Seth – 2019-08-29T10:40:00.770

But scores can go up or down, there's no predicting it. What if his score goes UP from last week to this week? Is there a formula to determine loss or gain? – June – 2019-08-29T12:00:06.343

See my answer. It's the same formula. It's just a subtraciton with the proper point of reference and it will have the proper positive (gain), negative (loss) result as well as showing a plateau (the difference is zero). – Seth – 2019-08-29T13:36:24.557

Answers

1

All you need to do is use simple subtraction with the proper points of reference. For the following table the letters represent:

  • X, Y, Z are Weeks
  • A, B are students
  • F is an abstraction of the formula
  • DA, DB is the difference for the previous week for each user.

Table example:

   X   Y    Z
A  10  10   20
B  10  20   10
---------------
F  0   Y-X  Z-Y
DA 0   0     10
DB 0   10   -10

All you need to do is deduct last weeks score from the previous weeks score to get the difference of the previous week. In other words it's Week (N) - Week (N-1) to get the score change Week (N).

Seth

Posted 2019-08-29T09:20:31.403

Reputation: 7 657

Thanks for all the help - I've got it!!!!!!!! – June – 2019-08-30T01:27:49.527

@June cool that you could get it to work. While I appreciate your thank you check out What should I do when someone answers my question? as this site might work different from what you expect. Continue to be an inspiring teacher!

– Seth – 2019-08-30T06:14:12.477