Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mark
 
Posts: n/a
Default I need help with the Sumif Function

I have a simple spreadsheet with numerical codes in column A. in column B i
have figures against each code. What i would like to do is use the sumif
function or any other function that would total the figures within a range of
codes. For example if the code is greater than 5000 but less than 7000 total
the figures in colum B for those codes.

The formula i have tried with no luck is

=SUMIF(A4:A20,"5000"&"<7000",B4:B20)

It seems to be the 2 conditions that are causing the problem, it works fine
with one condition but not with two.

Please advise

Thanx
Mark
  #2   Report Post  
zackb
 
Posts: n/a
Default

Hi Mark,

SUMIF cannot handle anymore than one condition. You'll either need an array
formula, a SumProduct formula, or two SumIf formulas. Depending on who you
talk to, some are better than others. If you are not using this often, or
have a small workbook, it's six one way and half-a-dozen the other.

Try ..

=SUMIF(A4:A20,"<7000",B4:B20)-SUMIF(A4:A20,"<5000",B4:B20)

--
Regards,
Zack Barresse, aka firefytr

"Mark" wrote in message
...
I have a simple spreadsheet with numerical codes in column A. in column B i
have figures against each code. What i would like to do is use the sumif
function or any other function that would total the figures within a range
of
codes. For example if the code is greater than 5000 but less than 7000
total
the figures in colum B for those codes.

The formula i have tried with no luck is

=SUMIF(A4:A20,"5000"&"<7000",B4:B20)

It seems to be the 2 conditions that are causing the problem, it works
fine
with one condition but not with two.

Please advise

Thanx
Mark



  #3   Report Post  
Ken Wright
 
Posts: n/a
Default

=SUMIF(A4:A20,"5000",B4:B20)-SUMIF(A4:A20,"=7000",B4:B20)

Sum everything above 5K, then sum everything above or equal to 7K and take
it away from the first calc.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Mark" wrote in message
...
I have a simple spreadsheet with numerical codes in column A. in column B

i
have figures against each code. What i would like to do is use the sumif
function or any other function that would total the figures within a range

of
codes. For example if the code is greater than 5000 but less than 7000

total
the figures in colum B for those codes.

The formula i have tried with no luck is

=SUMIF(A4:A20,"5000"&"<7000",B4:B20)

It seems to be the 2 conditions that are causing the problem, it works

fine
with one condition but not with two.

Please advise

Thanx
Mark



  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(--(A4:A205000),--(A4:A20<7000),B4:B20)

--
HTH

Bob Phillips

"Mark" wrote in message
...
I have a simple spreadsheet with numerical codes in column A. in column B

i
have figures against each code. What i would like to do is use the sumif
function or any other function that would total the figures within a range

of
codes. For example if the code is greater than 5000 but less than 7000

total
the figures in colum B for those codes.

The formula i have tried with no luck is

=SUMIF(A4:A20,"5000"&"<7000",B4:B20)

It seems to be the 2 conditions that are causing the problem, it works

fine
with one condition but not with two.

Please advise

Thanx
Mark



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to nest a left function within a sumif function? LisaK Excel Worksheet Functions 2 April 23rd 23 11:46 AM
SUMIF function yak10 Excel Worksheet Functions 0 February 12th 05 05:12 PM
SUMIF function yak10 Excel Worksheet Functions 3 February 12th 05 01:15 AM
help with "criterea" in the sumif function [email protected] Excel Worksheet Functions 3 December 17th 04 06:27 PM
how do you do a sumif function on more than one worksheet? BMWPRO Excel Worksheet Functions 1 December 6th 04 08:26 PM


All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"