Is there a "between" function?
John,
I have absolutely NO idea why this works, but it does! My thanks for your
assistance. What I wound up using was:
=SUMPRODUCT((--(G6:G59)5100)*(O6:O59))-SUMPRODUCT((--(G6:G59)5999)*(O6:O59))+SUMPRODUCT((--(G6:G59)=5007)*(O6:O59))+SUMPRODUCT((--(G6:G59)=5008)*(O6:O59))
I do not understand the logic here, but this is the first time I've seen
"sumproduct". Just not sure I could explain it to anyone else!! :)
Le
"John C" wrote:
Change the first part of the formula as follows:
SUMPRODUCT((--(C8:C56)=5100)*(E8:E56))-SUMPRODUCT((--(C8:C56)5999)*(E8:E56))
The double unary (-- in this case), ensures that the C8:C56 range will be
treated as a number, and then the math will workout. If you are still having
difficult, you may want to add the TRIM function (just type TRIM right after
the second dash in the 2 double unaries.
--
** John C **
"LRBryan" wrote:
John, unfortunately, this only works if the account in column C8:C56 is
either 5007 or 5008. It's not evaluating the accounts greater than 5100 and
less than 5999. The accounts were brought in as text...I may be able to go
back and format as number, but am not sure if it will work even then. Will
have to give it a try.
Thanks!
"John C" wrote:
You could do something like this:
=SUMIF(C8:C56,"=5100",E8:E56)-SUMIF(C8:C56,"5999",E8:E56)+SUMIF(C8:C56,5007,E8: E56)+SUMIF(C8:C56,5008,E8:E56)
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.
"LRBryan" wrote:
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!
|