Summing some of the values in a table in Excel.

Posted on 2011-03-22
Last Modified: 2012-05-11

Suppose you have a table of values in an Excel (2007) spreadsheet which is 10 columns wide and many rows in length (say A3:J5000).  Furthermore, suppose that column B has only three possible entries:  D, C and W.  In other words, none of the entries in column B is unique.

Now suppose that for a specified range in the table, you want to use =SUM() to add-up all the values (but only the values) in column G which have a "D" in column B.  What formula would do that?

I am familiar with using =LOOKUP() to locate values in a list or table.  However, I believe that =LOOKUP() is only usable when all values in the lookup column are unique.  Is that correct?

If so, then here, I am looking for a function in which those values do not have to be unique.

Question by:Steve_Brady
LVL 50

Accepted Solution

barry houdini earned 500 total points
ID: 35191567
Hello Steve

Sounds like you'd want SUMIF, so for the whole table


regards, barry
LVL 29

Expert Comment

ID: 35191569


Expert Comment

ID: 35191577
first question: =SUMIF() would do that.
second question: not necessarily unique, but lookup will only bring one result, the first one it finds.

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!


Expert Comment

ID: 35191586
LVL 29

Expert Comment

ID: 35191619
pls ignore my previous post barryhoudini your correct.

Author Closing Comment

ID: 35420677
Thanks Barry!

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction This Article is a follow-up to my Mappit! Addin Article (, it was inspired by an email posting I made to EUSPRIG (, I will briefly cover: 1) An overvie…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now