Home > Back-end >  How to calculate the difference of numbers in series using Google sheets formula?
How to calculate the difference of numbers in series using Google sheets formula?

Time:09-07

I have an inventory sheet, where I need to calculate the difference between the actual value and the series of expected values. Here is a snapshot of what I am talking about:

Image

So for Item1:

Current: 50

Expected: 45,45,45

Now I want to devise a formula that will calculate a difference until the last column in this specific row, something like this:

difference = 50-(45,45,45) //50-45 50-45 50-45 and so on (Q,R..)
difference = 15 //final result

Is there any way that we can achieve this by putting formula in a cell, any help would be much appreciated, thank you.

CodePudding user response:

In google-sheet you can use-

=ArrayFormula(SUM(M2-N2:P2))

In excel use below formula

=SUM(M2-N2:P2)

In case of non 365 version of excel you need to enter it as array means confirm by CTRL SHIFT ENTER.

enter image description here

  • Related