Forum Discussion
Using the IF function
Page 2 - I want to enter dollar amounts in one cell, then a code (A, B, C) in another cell.
Then, I want to add all the "A" codes on page 2 to one cell on page 1 as the total of all "A" amounts.
Your second description describes circumstances that (potentially) go quite a bit beyond your first, to the point that it might well not be a situation calling for use of IF, but something a bit more powerful/sophisticated.
It sounds as if it could be a check register or some other list of financial/monetary transactions that are on your Sheet 2, and a summary on Page 1. As such, and this is often true in Excel, there are probably several ways to do it, which one of which is most appropriate could depend on which version of Excel you are using.
For example, using to the extent I could your description to build this, see the attached sheet. There are two different formulas used on Sheet 1 to calculate the totals of numbers from Sheet 2 based on code A, B, or C. I display the formulas was well as the results. You can change the value in cell C1 on Sheet 1 to see how different codes produce different results.
(The second formula uses the FILTER function and will only work if you have a recent version of Excel; the other, using SUMIF, will work with older versions.)