Forum Discussion

fhhonergmailcom's avatar
fhhonergmailcom
Copper Contributor
Mar 28, 2023

Totaling

I have a sheet with five columns.  How do I get any amount entered in column three to be subtracted from the last amount in column five and any amount entered in column four to be added to the last amount in column five?  

  • mathetes's avatar
    mathetes
    Silver Contributor

    fhhonergmailcom 

     

    The attached gives a very basic example of one way to accomplish what you appear to be asking. I say "appear to be asking" because there's a lot of ambiguity in your question;

    • how are the columns arrayed,
    • are we talking of entries in the same row, or entries anywhere in columns 3 and 4,
    • and so forth. 

     

    FYI, all of the green background cells in the attached file have the same formula (which is written with the assumption that you mean for entries in columns 3 and 4 to be on the same row as the new total in column 5.

    The formula is =IF(SUM(C3:D3)=0,"",E2-C3+D3)

    The first clause in the IF function just keeps the row blank until an entry is made on that row.

Resources