If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > SUMIF function returns no result

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-17-09, 00:36
kim burke kim burke is offline
Registered User
 
Join Date: Aug 2007
Posts: 19
SUMIF function returns no result

Hi all, I am trying to use the SUMIF function but for some reason I do not get a result. If I copy an example into my worksheet the example works.



....A..........B......C......D.....E......F.....G. .....H......I.......J......K......L.......M....... N......O
1..Breed.....1.....1a.....2.....2a.....3.....3a... ..4.....4a.....5.....5a.....10.....10a.....11....1 1a
2..1austs.................................1
3..1cav.............1.............1
4..1cav.....................1
5..1cav........................................... ........1
6.. 1tib............................................1

Above is a sample of my spreadsheet. (Had to put ...'s to make columns)
My formula reads =SUMIF(A2:A6,"1cav",B2:O6)
Result should be 4
Result is 0 WHY?????

Last edited by kim burke; 09-17-09 at 00:58.
Reply With Quote
  #2 (permalink)  
Old 09-17-09, 06:58
CasparV CasparV is offline
Registered User
 
Join Date: Jul 2007
Posts: 54
SUMIF only totals the first column

At first glance this should work, but I think that SUMIF only totals one column, so you are getting the total of column B (which is zero!). I tried it on my Excel 2003 and that is what I get.

Therefore one solution would be to add column P which is the sum of all the preceding columns (ie SUM(B2:O2) and so on). Then your SUMIF would become =SUMIF(A2:A6,"1cav",P2:P6).

One thing to watch is if your column A entry contains "1cav " (ie the correct data but with a space before or after) then your SUMIF formula will not recognise it correctly. Likewise those 1 markers, if they are text and not numeric then the SUMIF won't count them.

HTH
Caspar
Reply With Quote
  #3 (permalink)  
Old 09-17-09, 09:26
pierrevbaexcel pierrevbaexcel is offline
Registered User
 
Join Date: Dec 2003
Location: Ottawa, Canada
Posts: 72
Forget SUMIF use SUMPRODUCT

Hi

The SUMPRODUCT formula to do this would be:

=SUMPRODUCT(($A$2:$A$6="1cav")*($B$2:$O$6))

With SUMPRODUCT you can add many columns, use many columns as criteria you can work with rows, you can count, sum, calculate average.

SUMPRODUCT is the most powerful function in Excel but more than 90% of users ignore this.

Even the Microsoft's developers ignore the potential of SUMPRODUCT. That is why they have spent Million$ to develop 4 new functions in 2007 that are totally useless (SUMIFS, COUNTIFS, AVERAGEIFS and AVERAGEIF). These new functions are useless because you can do what these functions do with a single function that has been in Excel since 1997 (SUMPRODUCT) and you can even do more with SUMPRODUCT.

Visit Microsoft excel functions and formulas
__________________
A piece of data is like a brick
If you don't build anything with it
It is just a brick
www.excel-examples.com
Reply With Quote
  #4 (permalink)  
Old 09-17-09, 18:43
kim burke kim burke is offline
Registered User
 
Join Date: Aug 2007
Posts: 19
Thanks CasparV - Using a separate totalled column works perfectly. The fact that SUMIF can only SUM one column is not mentioned anywhere. Thanks heaps.
Reply With Quote
  #5 (permalink)  
Old 09-17-09, 18:52
kim burke kim burke is offline
Registered User
 
Join Date: Aug 2007
Posts: 19
Hi Pierrevbaexcel - You are a marvel!!! SUMPRODUCT saves me putting in an extra column. I must look in to SUMPRODUCT and see what else I can use it for. Thanks heaps.
Reply With Quote
  #6 (permalink)  
Old 09-17-09, 19:21
pierrevbaexcel pierrevbaexcel is offline
Registered User
 
Join Date: Dec 2003
Location: Ottawa, Canada
Posts: 72
Sumproduct

Kim

SUMPRODUCT is the single function that I use the most to develop solutions for my clients (large and small enterprises).

Without any macros or any programming I have developed fully automated reporting applications downstream from large central database, accounting programs, sales programs, manufacturing programs....

I have developed permanent inventories and purchasing applications, production planning applications and the most simple and customizable accounting application that allows the user to develop reports by employee, supervisor, sub-project, types of work and any combination thereof.

I have designed a special tutorial on SUMPRODUCT and you can download it from my website along with the applications mentionned above (20 in all).

Visit http:\\Microsoft excel functions and formulas

Macros and VBA are also great tools. Visit

http:\\Free Help on VBA for Excel (Macros)
__________________
A piece of data is like a brick
If you don't build anything with it
It is just a brick
www.excel-examples.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On