Forum Discussion

Cas Ros's avatar
Cas Ros
Copper Contributor
Feb 28, 2018
Solved

Need help writing an excel formula

I'm trying to make a formula that sums the data below onto a single field. if the value in column A is bigger than the value in Column B of the same row i want the value of column A - the value of ...
  • Willy Lau's avatar
    Feb 28, 2018
    1. Select a cell of your table(I guess table6)
    2. Table Tools in Ribbon > Design tab > Table Style Options > check Total Row
    3. Go to the total row of the table, replace the subtotal formula with
      =SUMPRODUCT(N([total needed] > [parents got]) * ([total needed] - [parents got]) + N(NOT([total needed] > [parents got])) * ([total needed] - 1))

     

    Edition: Using the formula in total row of the table will make confusion.  You may use the above formula in any other cells.

     

    Also, use SUM function to wrap the formula in your post with Ctrl + Shift + Enter

    {=SUM(IF(Tabel6[total needed] > Tabel6[parents got],Tabel6[total needed] - Tabel6[parents got],Tabel6[total needed] - 1))}

     note: I use comma (,) to seperate parameters; you may need to change it back to semi-colon(;) if that works on your side.

Resources