Solved

Adding only records that meet a criteria

Posted on 2011-09-21
4
169 Views
Last Modified: 2012-05-12
Hello:

I have a spreadsheet with several columns in it.  The values that I want to add are in the columns.  I only want to add the columns where the heading for that column is "add".

Of course I can just choose those cells, but I am looking for a formula that will only add the values when the heading(or cell above them say "add")

I am attaching a small example.

Thank you! exampleofadd.xlsx
0
Comment
Question by:MeowserM
  • 2
  • 2
4 Comments
 
LVL 50

Expert Comment

by:barry houdini
ID: 36574254
Try using SUMIF function, i.e. this formula

=SUMIF(B$2:J$2,"add",B3:J3)

regards, barry
0
 

Author Comment

by:MeowserM
ID: 36574448
awesome - can I use this with countif too?
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36574603
To count what? You can count the number of "add"s in a range, e.g.

=COUNTIF(B$2:J$2,"add")

....but if you want to count how many numbers in your range are in the "add" columns but also meet another criterion, e.g. larger than 5 then you can use COUNTIFS (with an "S") like this

=COUNTIFS(B$2:J$2,"add",B3:J3,">5")

regards, barry


0
 

Author Comment

by:MeowserM
ID: 36575001
That's perfect - Thank you Barry!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question