Solved

Adding only records that meet a criteria

Posted on 2011-09-21
4
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

724 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