Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 02-08-2010, 09:27 AM
BobTheRockeer BobTheRockeer is offline
Registered User
 
Join Date: 05 Feb 2010
Location: Bedfordshire, UK
MS Office Version:Excel 2003
Posts: 8
BobTheRockeer is becoming part of the community
Simplifying a Sumproduct formula

Please Register to Remove these Ads

I'm using Excel 2003. I have been using SUMPRODUCT to look at too compare columns and data that is contained in both.

Column L11:L52 contains the numbers 1 to 4 and Column K11:K52 contains the word YES in some cells. I just want to look and see if text is contained in a row in column L is it contained in that row in column K. This is the formula I'm using but it seems over complicated and I'm sure there is a way of just looking if the cell contains information without worrying what it is.

=SUMPRODUCT(--(Data!$L$11:$L$52=1),--(Data!$K$11:$K$52="YES"))+SUMPRODUCT(--(Data!$L$11:$L$52=2),--(Data!$K$11:$K$52="YES"))+SUMPRODUCT(--(Data!$L$11:$L$52=3),--(Data!$K$11:$K$52="YES"))+SUMPRODUCT(--(Data!$L$11:$L$52=4),--(Data!$K$11:$K$52="YES"))

Any help gratefully recieved, I'm something of an amateur at this.

Last edited by BobTheRockeer; 02-08-2010 at 09:50 AM.
Reply With Quote
  #2  
Old 02-08-2010, 09:34 AM
rwgrietveld's Avatar
rwgrietveld rwgrietveld is offline
Forum Guru
 
Join Date: 02 Sep 2008
Location: Netherlands
MS Office Version:XL 2007 / XL 2010
Posts: 1,605
rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability
Re: Simplifying a Sumproduct formula

This Array function would work
Code:
=SUM(--(K11:K52<>"")*(L11:L52<>""))
Press Ctrl+Shift+Enter

Alternative
Code:
=SUM(NOT(ISBLANK(K11:K52))*NOT(ISBLANK(L11:L52)))
__________________
Looking for great solutions but hate waiting?
Seach this Forum through Google

www.Google.com
(e.g. +multiple +IF site:excelforum.com/excel-general/ )

www.Google.com
(e.g. +fill +combobox site:excelforum.com/excel-programming/ )

Ave,
Ricardo
Reply With Quote
  #3  
Old 02-08-2010, 09:51 AM
BobTheRockeer BobTheRockeer is offline
Registered User
 
Join Date: 05 Feb 2010
Location: Bedfordshire, UK
MS Office Version:Excel 2003
Posts: 8
BobTheRockeer is becoming part of the community
Re: Simplifying a Sumproduct formula

=SUM(--(K11:K52<>"")*(L11:L52<>""))

The array formula above fixed it but could not get the other to work.

Thank you very much!
Reply With Quote
  #4  
Old 02-08-2010, 09:52 AM
DonkeyOte's Avatar
DonkeyOte DonkeyOte is offline
Forum Guru
 
Join Date: 22 Oct 2008
Location: Suffolk, UK
MS Office Version:2002 & 2007
Posts: 13,573
DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute
Re: Simplifying a Sumproduct formula

You can of course still use SUMPRODUCT if you prefer ?

=SUMPRODUCT(--ISNUMBER($L$11:$L$52),--($K$11:$K$52="Yes"))

or if you wish to restrict to just 1 to 4

=SUMPRODUCT(--ISNUMBER(MATCH($L$11:$L$52,{1,2,3,4},0)),--($K$11:$K$52="Yes"))

If you want to avoid SUMPRODUCT and Arrays altogether simply use concatenation in another column, eg:

M11: =L11&"@"&K11
copied down

Then

=SUM(COUNTIF($M$11:$M$52,{1,2,3,4}&"@Yes"))
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump