Forum Discussion

MaryK170's avatar
MaryK170
Copper Contributor
Jul 19, 2022

Moving value form one sheet to another, and choosing a cell based on negative or positive value.

I have a sheet 'Calculations' where a sum of values is being calculated. Sometimes that sum is positive sometimes it's negative.

On another sheet 'Recap', I have a debit and credit columns.

I want to move the sum form Calculations to Recap.

The sum must go into a column based on negative "Credit" or positive "Debit" value.

 

Thank you in advance!

  • MaryK170 

    =IF(AND(SUMIF(Calculations!$B$2:$B$11,Recap!$B2,Calculations!$C$2:$C$11)>0,C$1="debit"),SUMIF(Calculations!$B$2:$B$11,Recap!$B2,Calculations!$C$2:$C$11),IF(AND(SUMIF(Calculations!$B$2:$B$11,Recap!$B2,Calculations!$C$2:$C$11)<0,C$1="credit"),SUMIF(Calculations!$B$2:$B$11,Recap!$B2,Calculations!$C$2:$C$11),""))

    You can try this formula for the data layout of the example. I copied the formula across range C2:D6.

     

Resources