# Thread: Do sum of cells having specific code in front be done

1. ## Do sum of cells having specific code in front be done

Hello,
I am Dr Kunvar Harsh from India
I wanted to know if there is any way I can put formula to sum all those items with code e.g E C, H C, K C, KH C (where C stands for-COMMON account) separately from the whole list of item codes having various codes like E H, E K, K H, K K etc..
Thank you  Reply With Quote

2. Try

=SUM(COUNTIF(A1:A100,{"E C","H C","K C","KH C"}))  Reply With Quote

3. Originally Posted by Bob Phillips Try

=SUM(COUNTIF(A1:A100,{"E C","H C","K C","KH C"}))
 Monthly expenses Code meaning Date Amount Code Codes Account used 1 April 15000 R C R C Repair Common 3 April 3000 F K F K Fuel Common 5 April 1400 G K G K Grocery Kunvar 6 April 1200 G C G C Grocery Common Common account expenses 16200 Desired result based upon code R C & G C Kunvar expenses 4400 Desired result based upon code F K & G K
In the above given example, I want that the moment I enter respective code , its total is updated under its respective account expenses; common or Kunvar. I hope this time the problem is quite clear.  Reply With Quote

4. Proper spec always helps, the problem was clear the first time, just wrongly stated.

=SUM(SUMIF(\$E\$3:\$E\$6,{"R C","G C"},\$B\$3:\$B\$6))

etc.  Reply With Quote

5. ##  Originally Posted by Bob Phillips Proper spec always helps, the problem was clear the first time, just wrongly stated.

=SUM(SUMIF(\$E\$3:\$E\$6,{"R C","G C"},\$B\$3:\$B\$6))

etc.
Thank you so much!! did work.. :-)   Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•