Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Left as a condition in SUMPRODUCT

This function works fine until I insert the LEFT condition. Any ideas
on how to make it work? I tried entering it as an array as well and
nothing.

Works:
=SUMPRODUCT((Summary!M7:M65536=1)*(Summary!K7:K655 36=1),(Summary!
J7:J65536))

Doesn't work:
=SUMPRODUCT((Summary!M7:M65536=1)*(LEFT(Summary!K7 :K65536,1)=1),
(Summary!J7:J65536))

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Left as a condition in SUMPRODUCT

LEFT() returns a string, which you're comparing to a number. Try:

=SUMPRODUCT(--(Summary!M7:M65536=1),--(LEFT(Summary!K7:K65536,1)="1"),
Summary!J7:J65536)


In article .com,
Kigol wrote:

This function works fine until I insert the LEFT condition. Any ideas
on how to make it work? I tried entering it as an array as well and
nothing.

Works:
=SUMPRODUCT((Summary!M7:M65536=1)*(Summary!K7:K655 36=1),(Summary!
J7:J65536))

Doesn't work:
=SUMPRODUCT((Summary!M7:M65536=1)*(LEFT(Summary!K7 :K65536,1)=1),
(Summary!J7:J65536))

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Left as a condition in SUMPRODUCT

=left() returns a string.

....*(LEFT(Summary!K7:K65536,1)="1"), ...



Kigol wrote:

This function works fine until I insert the LEFT condition. Any ideas
on how to make it work? I tried entering it as an array as well and
nothing.

Works:
=SUMPRODUCT((Summary!M7:M65536=1)*(Summary!K7:K655 36=1),(Summary!
J7:J65536))

Doesn't work:
=SUMPRODUCT((Summary!M7:M65536=1)*(LEFT(Summary!K7 :K65536,1)=1),
(Summary!J7:J65536))


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Left as a condition in SUMPRODUCT

Yes of course that makes sense. Thank you. Also, I have tried a few
times in the past but to make sure. You cannot use OR or AND in
SUMPRODUCT functions correct? You would just have to SUM two different
SUMPRODUCT functions with different conditions?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Left as a condition in SUMPRODUCT

You can add more requirements with something like:
=sumproduct(--(a1:a10="hi"),--(b1:b10="there"),c1:c10)
(And-ing column A with column B)

You could use:
=sumproduct(--(((a1:a10="hi")+(b1:b10="there"))0),c1:c10)
(Or-ing column A with column B)

This was recently posted by Peo Sjoblom:
One way
=SUMPRODUCT(--(A2:A10="N"),--((B2:B10=4)+(B2:B10=5)0))
another
=SUMPRODUCT(((A2:A10="N")*(B2:B10={4,5})))

======
Can you figure out what it does? <bg (answer below...)

Those people who answer lots of questions in .worksheet.functions are pretty
darn smart.

If you have followup questions, you may want to post in that newsgroup with the
details.

..scroll down for the answer
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
From the OP:
What I am trying to do is to count the number of "N"s in a column that
happen to be in the same row with another column that shows a 4 or 5.




Kigol wrote:

Yes of course that makes sense. Thank you. Also, I have tried a few
times in the past but to make sure. You cannot use OR or AND in
SUMPRODUCT functions correct? You would just have to SUM two different
SUMPRODUCT functions with different conditions?


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Left as a condition in SUMPRODUCT

Left works on strings and sumproducts is works on numbers. You need to
convert. Not sure what you data is.

value(Text) to convert text to number

text(number,"general") to convert number ot text


"Kigol" wrote:

This function works fine until I insert the LEFT condition. Any ideas
on how to make it work? I tried entering it as an array as well and
nothing.

Works:
=SUMPRODUCT((Summary!M7:M65536=1)*(Summary!K7:K655 36=1),(Summary!
J7:J65536))

Doesn't work:
=SUMPRODUCT((Summary!M7:M65536=1)*(LEFT(Summary!K7 :K65536,1)=1),
(Summary!J7:J65536))


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Left as a condition in SUMPRODUCT

Left returns a string and not a value. Put the 1 in quotes...

=SUMPRODUCT((Summary!M7:M65536=1)*(LEFT(Summary!K7 :K65536,1)="1"),
(Summary!J7:J65536))
--
HTH...

Jim Thomlinson


"Kigol" wrote:

This function works fine until I insert the LEFT condition. Any ideas
on how to make it work? I tried entering it as an array as well and
nothing.

Works:
=SUMPRODUCT((Summary!M7:M65536=1)*(Summary!K7:K655 36=1),(Summary!
J7:J65536))

Doesn't work:
=SUMPRODUCT((Summary!M7:M65536=1)*(LEFT(Summary!K7 :K65536,1)=1),
(Summary!J7:J65536))


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
Can I use Sumproduct with the LEFT Function? Chris Excel Worksheet Functions 11 April 13th 10 07:31 PM
Sumproduct with Condition OR Sumproduct with ADDRESS function - HE gholly Excel Discussion (Misc queries) 2 September 28th 09 05:07 PM
SUMPRODUCT AND LEFT K Excel Worksheet Functions 6 July 8th 08 07:09 PM
Left and Sumproduct Alexball Excel Discussion (Misc queries) 1 August 9th 06 12:00 PM
LEFT embedded in SUMPRODUCT marika1981 Excel Programming 3 May 20th 05 07:27 PM


All times are GMT +1. The time now is 08:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"