Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 770
Default if statements in sumproduct formula

I have the following formula:

=SUMPRODUCT((IF($G$5<"",rngDate=$G$5,rngDate<"" ))*(IF($H$5<"",rngDate<=$H$5,rngDate<""))*(IF($I $5<"",rngUse=$I$5,rngUse<""))*(IF($J$5<"",rngSo urce=$J$5,rngSource<""))*rngAmount)

It evaluates to 0, which is not what I expect. If I go through with F9 and
on each If statement, I get a series of {TRUE, FALSE, TRUE} as expected and
if I then hit Enter, the formula evaluates to the amount I expect.

I thought maybe the formula was too long, but I get the same result if I
include only two sets of conditions.

Thanks,

Doug Glancy


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default if statements in sumproduct formula

Why not just use

=SUMPRODUCT(((($G$5<"")*(rngDate=$G$5))+(($G$5=" ")*(rngDate<"")))*

((($H$5<"")*(rngDate<=$H$5))+(($H$5="")*(rngDate< "")))*

((($I$5<"")*(rngUse=$I$5))+(($I$5="")*(rngUse<"" )))*

((($J$5<"")*(rngSource=$J$5))+(($J$5="")*(rngSour ce<"")))*rngAmount)


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Doug Glancy" wrote in message
...
I have the following formula:


=SUMPRODUCT((IF($G$5<"",rngDate=$G$5,rngDate<"" ))*(IF($H$5<"",rngDate<=$
H$5,rngDate<""))*(IF($I$5<"",rngUse=$I$5,rngUse< ""))*(IF($J$5<"",rngSour
ce=$J$5,rngSource<""))*rngAmount)

It evaluates to 0, which is not what I expect. If I go through with F9

and
on each If statement, I get a series of {TRUE, FALSE, TRUE} as expected

and
if I then hit Enter, the formula evaluates to the amount I expect.

I thought maybe the formula was too long, but I get the same result if I
include only two sets of conditions.

Thanks,

Doug Glancy




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 770
Default if statements in sumproduct formula

Bob,

Because I'm not as smart as you?

Thanks, that works.

Doug


"Bob Phillips" wrote in message
...
Why not just use

=SUMPRODUCT(((($G$5<"")*(rngDate=$G$5))+(($G$5=" ")*(rngDate<"")))*

((($H$5<"")*(rngDate<=$H$5))+(($H$5="")*(rngDate< "")))*

((($I$5<"")*(rngUse=$I$5))+(($I$5="")*(rngUse<"" )))*

((($J$5<"")*(rngSource=$J$5))+(($J$5="")*(rngSour ce<"")))*rngAmount)


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Doug Glancy" wrote in message
...
I have the following formula:


=SUMPRODUCT((IF($G$5<"",rngDate=$G$5,rngDate<"" ))*(IF($H$5<"",rngDate<=$
H$5,rngDate<""))*(IF($I$5<"",rngUse=$I$5,rngUse< ""))*(IF($J$5<"",rngSour
ce=$J$5,rngSource<""))*rngAmount)

It evaluates to 0, which is not what I expect. If I go through with F9

and
on each If statement, I get a series of {TRUE, FALSE, TRUE} as expected

and
if I then hit Enter, the formula evaluates to the amount I expect.

I thought maybe the formula was too long, but I get the same result if I
include only two sets of conditions.

Thanks,

Doug Glancy






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default if statements in sumproduct formula

My 'just' was referring to not being smart with embedded IFs <BG

Bob


"Doug Glancy" wrote in message
...
Bob,

Because I'm not as smart as you?

Thanks, that works.

Doug


"Bob Phillips" wrote in message
...
Why not just use

=SUMPRODUCT(((($G$5<"")*(rngDate=$G$5))+(($G$5=" ")*(rngDate<"")))*

((($H$5<"")*(rngDate<=$H$5))+(($H$5="")*(rngDate< "")))*

((($I$5<"")*(rngUse=$I$5))+(($I$5="")*(rngUse<"" )))*

((($J$5<"")*(rngSource=$J$5))+(($J$5="")*(rngSour ce<"")))*rngAmount)


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Doug Glancy" wrote in message
...
I have the following formula:



=SUMPRODUCT((IF($G$5<"",rngDate=$G$5,rngDate<"" ))*(IF($H$5<"",rngDate<=$

H$5,rngDate<""))*(IF($I$5<"",rngUse=$I$5,rngUse< ""))*(IF($J$5<"",rngSour
ce=$J$5,rngSource<""))*rngAmount)

It evaluates to 0, which is not what I expect. If I go through with F9

and
on each If statement, I get a series of {TRUE, FALSE, TRUE} as expected

and
if I then hit Enter, the formula evaluates to the amount I expect.

I thought maybe the formula was too long, but I get the same result if

I
include only two sets of conditions.

Thanks,

Doug Glancy








  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 770
Default if statements in sumproduct formula

Bob,

My response was an attempt at a witty balance of humor and appreciation <g.

I had never seen it done the way you have here, with addition inside the
Sumproduct, so I learned something new.

Thanks for all your help in these groups, and for your quick response to my
question.

Doug


"Bob Phillips" wrote in message
...
My 'just' was referring to not being smart with embedded IFs <BG

Bob


"Doug Glancy" wrote in message
...
Bob,

Because I'm not as smart as you?

Thanks, that works.

Doug


"Bob Phillips" wrote in message
...
Why not just use

=SUMPRODUCT(((($G$5<"")*(rngDate=$G$5))+(($G$5=" ")*(rngDate<"")))*

((($H$5<"")*(rngDate<=$H$5))+(($H$5="")*(rngDate< "")))*

((($I$5<"")*(rngUse=$I$5))+(($I$5="")*(rngUse<"" )))*

((($J$5<"")*(rngSource=$J$5))+(($J$5="")*(rngSour ce<"")))*rngAmount)


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Doug Glancy" wrote in message
...
I have the following formula:



=SUMPRODUCT((IF($G$5<"",rngDate=$G$5,rngDate<"" ))*(IF($H$5<"",rngDate<=$

H$5,rngDate<""))*(IF($I$5<"",rngUse=$I$5,rngUse< ""))*(IF($J$5<"",rngSour
ce=$J$5,rngSource<""))*rngAmount)

It evaluates to 0, which is not what I expect. If I go through with
F9
and
on each If statement, I get a series of {TRUE, FALSE, TRUE} as
expected
and
if I then hit Enter, the formula evaluates to the amount I expect.

I thought maybe the formula was too long, but I get the same result if

I
include only two sets of conditions.

Thanks,

Doug Glancy












  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default if statements in sumproduct formula

Doug,

The addition, or plus sign, denotes an OR to SP, just as * denotes AND.

Bob

"Doug Glancy" wrote in message
...
Bob,

My response was an attempt at a witty balance of humor and appreciation

<g.

I had never seen it done the way you have here, with addition inside the
Sumproduct, so I learned something new.

Thanks for all your help in these groups, and for your quick response to

my
question.

Doug




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
Find value in array Brook6 Excel Worksheet Functions 26 January 30th 07 09:40 PM
Array formula and multiplying conditions KR Excel Worksheet Functions 6 September 22nd 06 12:33 AM
Adding "OR" to a Sumproduct Formula Duke Carey Excel Worksheet Functions 0 March 21st 06 06:41 PM
Shorten sumproduct formula Andre Croteau Excel Discussion (Misc queries) 1 December 11th 04 10:30 PM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


All times are GMT +1. The time now is 04:29 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"