View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default Is there a "between" function?

Have a look here to learn more
For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Persistence!! I was a university prof for 40 years!!
all the best
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"LRBryan" wrote in message
...
Yes, it does! My thanks for your persistence!

Le

"Bernard Liengme" wrote:

As Glen points out the name SUMPRODUCT is misleading you.
We are multiplying the values by 1 if we want them and by 0 if we do not
want them
Try the formal on some simple data; It does work, I tried it!
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"LRBryan" wrote in message
...
Bernard, I did give this a try but am thinking this is not really doing
what
I need it to do because I'm not trying to sum products.

To explain, I have a number of lines containing account codes (col
C6:C58)
and budgeted amounts (col E6:E58).

In a single cell, I need to sum the budgeted amounts of all accounts
that
have codes that fall between 5100 and 5999, OR if they are accounts
5007
or
5008.

Thanks!

"Bernard Liengme" wrote:

let's do it in two stages
To get the ones for C between 5100 and 5999
=SUMPRODUCT( (C8:C14=5100)*(C8:C14<=5999), E8:E14)
To get the ones for C = 5007 or 5008
=SUMPRODUCT( (C8:C14=5007)+(C8:C14=5008), E8:E14)
or
=SUMPRODUCT( (C8:C14={5007,5008})* E8:E14)

We can use both in
=SUMPRODUCT( (C8:C14=5100)*(C8:C14<=5999), E8:E14) + SUMPRODUCT(
(C8:C14={5007,5008})* E8:E14)
or
=SUMPRODUCT( (C8:C14=5100)*(C8:C14<=5999)+ (C8:C14={5007,5008})*
E8:E14)


Note I used a smaller test range: change 14 to 56 everywhere
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"LRBryan" wrote in message
...
Hi - I'm trying to use the "sumif" function, but have a large number
of
variables to check for. What I'd like to do is:

=sumif(C8:C56,OR(between(5100,5999),5007,5008),E8: E56)

but this does not work (I'm assuming because the "between" function
is
not
valid.

Is there another way to do this?

Thanks!