Comparing/matching totals in a column to totals in a row

N

Nicole L.

Is there a way to put a formula in a cell to compare the total of the cells
above it (the column) and the totals of the data in the cells to the left of
it (the row) to make sure they match up? I would use this just to make sure
that I hadn't messed up any of my SUMs throughout the worksheet. Just as a
doublechecking mechanism.

Thanks
 
K

Ken Wright

=ROUND(SUM(H1:H100),2)=ROUND(SUM(A101:G101),2) could be one way. I use
round in there because for various reasons (floating point accuracy) you
could have say what looks like 0.2 = 0.2 as a result (and you would expect
TRUE) which was in reality 0.2=0.19999999999 or something similar and
returned FALSE.

http://cpearson.com/excel/rounding.htm

Use conditional formatting to flag the cell bright red if the answer is
FALSE.
 
N

Nicole L.

Is there an "IF... Then" option I can use?

Like:
If SUM(H1:H100),2=SUM(A101:G101),2, then input the Sum.
And if SUM(H1:H100),2 does NOT equal SUM(A101:G101),2, then input "ERROR".

(By the way, do I need the ",2"? I'm not sure what that denotes.)

Thanks
 
K

Ken Wright

The 2 was part of the ROUND function that I was using, and rounded the two
values each to 2 dps which was enough generally for me to be sure that the
two values were equal.

You can go with or without the ROUND but I'm generally belt and braces with
this kind of stuff and like to cover all the angles if I can.

Either
=IF(ROUND(SUM(H1:H100),2)=ROUND(SUM(A101:G101),2),SUM(A101:G101),"ERROR")

or without the round

=IF(SUM(H1:H100)=SUM(A101:G101),SUM(A101:G101),"ERROR")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top