Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / May 2008

Tip: Looking for answers? Try searching our database.

Amend formula?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kirstie Adam - 30 May 2008 16:13 GMT
Hi all,

I have the following formula which works well:

SUMPRODUCT((Main!$G$4:$G$2885 = "I")*(Main!T4:T2885))

but i want to amend it slightly to check if column B equals GL as well -
think that is: (Main!$B$4:$B$2885 = "GL")

but i don't know how!!

Thanks,

Kirstie
Rick Rothstein (MVP - VB) - 30 May 2008 16:28 GMT
SUMPRODUCT works by multiply numbers (row-by-row) and then adding those
individual products up. Your numbers can be actual values and/or logical
expressions. The reason your formula works is because the logical expression

   (Main!$G$4:$G$2885 = "I")

evaluates to either TRUE or FALSE which, when used in a mathematical
expression (your multiplication for example), is converted to 1 or 0 in
order to be used in that calculation. So, if the value the logical
expression is multiplied by is TRUE, the rest of the values in the
mathematical expression get multiplied by 1, which keeps them in the final
summation that SUMPRODUCT performs; and, if FALSE, the rest of the values in
the mathematical expression get multiplied by 0, the product of which is 0,
which effectively removes them from the final summation that SUMPRODUCT
performs. In effect, those logical expressions act as IF-THEN filters. So,
if you want another IF-THEN type test, just multiply its logical expression
with the rest of the items being multiplied. Hence, you want this...

=SUMPRODUCT((Main!$B$4:$B$2885 = "GL")*(Main!$G$4:$G$2885 =
"I")*(Main!T4:T2885))

Rick

> Hi all,
>
[quoted text clipped - 10 lines]
>
> Kirstie
Kirstie Adam - 30 May 2008 16:31 GMT
Thanks for that......and i really appreciate the explanation for sumproduct
too. i managed to do it with help from the group, but was never very sure
WHY it worked.

great!

Kirstie

> SUMPRODUCT works by multiply numbers (row-by-row) and then adding those
> individual products up. Your numbers can be actual values and/or logical
[quoted text clipped - 35 lines]
>>
>> Kirstie
Rick Rothstein (MVP - VB) - 30 May 2008 16:47 GMT
See inline comments...

> Thanks for that......

You are most welcome.

> and i really appreciate the explanation for sumproduct  too. i managed to
> do it with help from the group, but was never very sure  WHY it worked.

I figured that out from your question; hence, my brief explanation for how
SUMPRODUCT worked. For more details on this remarkably useful and flexible
function, see here...

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

Also, this one for an explanation of array functions (what is ulitmately
behind how the SUMPRODUCT function works)...

http://www.cpearson.com/excel/ArrayFormulas.aspx

Rick

> great!
>
[quoted text clipped - 39 lines]
>>>
>>> Kirstie
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.