close

=SUM(IF(MONTH($A7)=MONTH(DTd)*IF(DTam=quot;Mquot;,1,0),DTe b),IF(MONTH($A7)=MONTH(DTd)*IF(DTam=quot;Aquot;,1,0),DTeb) )I would like to combine if possible to read something like this?
Doable?

=SUM(IF(MONTH($A7)=MONTH(DTd)*IF(OR(IF(DTam=quot;Mquot;,1, 0),IF(DTam=quot;Aquot;,1,0)),DTeb)))I can't seem to get the OR to work? Basically I am trying to simplify
the formula.

Let me know if I need to clarrify this any further?--
JustMe602
------------------------------------------------------------------------
JustMe602's Profile: www.excelforum.com/member.php...oamp;userid=27854
View this thread: www.excelforum.com/showthread...hreadid=498002Hi!

Try this (not an array, normally entered):

=SUMPRODUCT(--(MONTH(DTd)=MONTH($A7)),--(ISNUMBER(MATCH(DTam,{quot;Mquot;,quot;Aquot;},0))),DTeb)

Biff

quot;JustMe602quot; gt; wrote
in message ...
gt;
gt; =SUM(IF(MONTH($A7)=MONTH(DTd)*IF(DTam=quot;Mquot;,1,0),DTe b),IF(MONTH($A7)=MONTH(DTd)*IF(DTam=quot;Aquot;,1,0),DTeb) )
gt;
gt;
gt; I would like to combine if possible to read something like this?
gt; Doable?
gt;
gt; =SUM(IF(MONTH($A7)=MONTH(DTd)*IF(OR(IF(DTam=quot;Mquot;,1, 0),IF(DTam=quot;Aquot;,1,0)),DTeb)))
gt;
gt;
gt; I can't seem to get the OR to work? Basically I am trying to simplify
gt; the formula.
gt;
gt; Let me know if I need to clarrify this any further?
gt;
gt;
gt; --
gt; JustMe602
gt; ------------------------------------------------------------------------
gt; JustMe602's Profile:
gt; www.excelforum.com/member.php...oamp;userid=27854
gt; View this thread: www.excelforum.com/showthread...hreadid=498002
gt;

Okay thanks for the reply it but I am confused on the syntax. And how
and why it worked.

=SUMPRODUCT(--(MONTH($A7)=MONTH(DTd2006)),--(ISNUMBER(MATCH(DTam2006,{quot;Mquot;,quot;Aquot;},0))),DTeb2006)What does the quot;--quot; two dashes do?

I guess I really don't understand how the SUMPRODUCT works.

Before the first comma, for instance, this matches where the two
columns/ranges equal the same month. Then the ISNUMBER(MATCH... this
section looks for intances where DTam2006 equals quot;Mquot; or quot;Aquot; then brings
back the information in the range DTeb2006. But why without an if
statement?

Please if anyone could help explain this it would be greatly
appriciated and again thanks for the formula.

JustMe.--
JustMe602
------------------------------------------------------------------------
JustMe602's Profile: www.excelforum.com/member.php...oamp;userid=27854
View this thread: www.excelforum.com/showthread...hreadid=498002Hi!

The formula is operating on 3 arrays:

DTd2006
DTam2006
DTeb2006

On the first 2 arrays you're performing a logical test:

MONTH($A7)=MONTH(DTd2006)
ISNUMBER(MATCH(DTam,{quot;Mquot;,quot;Aquot;},0)

The results of those tests will return the logical values of either TRUE or
FALSE.

The quot;--quot; converts those to numeric values where TRUE = 1 and FALSE = 0.

Then all 3 arrays are multiplied together and then the results of the
multiplication are summed together to get the final result. It would look
like this:

1*1*10 = 10
1*0*12 = 0
0*0*15 = 0
0*1*10 = 0
1*1*20 = 20

result = 30

See:

www.xldynamic.com/source/xld.SUMPRODUCT.html

Biff

quot;JustMe602quot; gt; wrote
in message ...
gt;
gt; Okay thanks for the reply it but I am confused on the syntax. And how
gt; and why it worked.
gt;
gt; =SUMPRODUCT(--(MONTH($A7)=MONTH(DTd2006)),--(ISNUMBER(MATCH(DTam2006,{quot;Mquot;,quot;Aquot;},0))),DTeb2006)
gt;
gt;
gt; What does the quot;--quot; two dashes do?
gt;
gt; I guess I really don't understand how the SUMPRODUCT works.
gt;
gt; Before the first comma, for instance, this matches where the two
gt; columns/ranges equal the same month. Then the ISNUMBER(MATCH... this
gt; section looks for intances where DTam2006 equals quot;Mquot; or quot;Aquot; then brings
gt; back the information in the range DTeb2006. But why without an if
gt; statement?
gt;
gt; Please if anyone could help explain this it would be greatly
gt; appriciated and again thanks for the formula.
gt;
gt; JustMe.
gt;
gt;
gt; --
gt; JustMe602
gt; ------------------------------------------------------------------------
gt; JustMe602's Profile:
gt; www.excelforum.com/member.php...oamp;userid=27854
gt; View this thread: www.excelforum.com/showthread...hreadid=498002
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()