# Adding the rows value if one column numbers match

1. ## Adding the rows value if one column numbers match

Sir

Again I need another formula. I hope you help me like last time.

Musiri4P.xlsx

As you see extent and total tax in D and E columns respectively.

Now I need to add those columns rows in G and H respectively only when PATTA NO in A column is same. like put in above screenshot.

It is tedious and error prone if done manually. So Please device any formula for this.  Register To Reply

2. ## Re: Adding the rows value if one column numbers match

use in row 2

=IF(COUNTIF(\$A\$2:\$A2,\$A2)>1,"",SUMIF(\$A\$2:\$A\$1693,\$A2,D\$2:D\$1693))

Copy down and across

See attached highlighted  Register To Reply

3. ## Re: Adding the rows value if one column numbers match

Thanks a Lot Sir! This is very quick!

Really you are the XL God sir!

I really want to learn advance XL like you!  Register To Reply

4. ## Re: Adding the rows value if one column numbers match

Sir

Now I need a improvement in above formula

I replaced land type column 'C' like

W - 1
D - 0

Musiri4PT.xlsx

now in G and H total extent and tax of patta will be calculated if only land type column 'C' value = 1 (that is wet)

and

in I and J total extent and tax of patta will be calculated if only land type column 'C' value = 0 (that is dry)  Register To Reply

5. ## Re: Adding the rows value if one column numbers match  Register To Reply

6. ## Re: Adding the rows value if one column numbers match

In G2,

=IF(COUNTIF(\$A\$2:\$A2,\$A2)=1,SUMIFS(D:D,\$A:\$A,\$A2,\$C:\$C,1),"")

then copy to H2.

In I2,

=IF(COUNTIF(\$A\$2:\$A2,\$A2)=1,SUMIFS(D:D,\$A:\$A,\$A2,\$C:\$C,0),"")

then copy to J2,

Finally copy G2:H2, then fill down.  Register To Reply

7. ## Re: Adding the rows value if one column numbers match

Thanks Sir!

Works Great!   Register To Reply