Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sumproduct and finding partial strings

Sumproduct is just a convenience. What you are actually doing is an array
formula. Sumproduct allows you to enter some types of array formulas
without use array type entry (ctrl+Shift+Enter). So what you are looking
for is information on Array formulas. You should probably ask the question
on tutorials or documentation over in worksheet.functions. Aladin Arydik
(sp) often posts a reference to a long explanation he gave to this in Mr.
Excel (I believe).
http://www.mrexcel.com/wwwboard/messages/8961.html

Chip Pearson
http://www.cpearson.com/excel/array.htm

Bob Umlas wrote a white paper on them. I think Bob Philips (who you have
been working with) has information on his site.

--
Regards,
Tom Ogilvy


"Jeff" wrote in message
...
Thanks TOm I'll give it a try. The snippit I showed in my request was just
one part of a 5 condition sumproduct statement.

Is there a good book or advanced tutorial on all the quirks of Sumproduct.

I
love it as a function, but I am having a bit of trouble getting the

operators
and conventions down.

"Tom Ogilvy" wrote:

Note that for a single condition like this, SUMIF will work and is

easier

set rng = Worksheets("Release Plan (1,2,3,4).xls").Worksheets( _
ShtRef).Range(CntRef5.Address)
MyCount = xlApp.Sumif(rng,"SME*")


or if CntRef5 is the actual range

MyCount = xlApp.Sumif(CntRef5,"SME*")

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
xlApp.Evaluate("=SUMPRODUCT(--(LEFT('[Release Plan (1,2,3,4).xls]" & _
ShtRef & "'!" & CntRef5.Address & _
",3)=""SME""))")

test out the string portion in the immediate window

shtRef = "Sheet1"
set CntRef5 = Range("B9:B50")
? ("=SUMPRODUCT(--(LEFT('[Release Plan (1,2,3,4).xls]" & _
ShtRef & "'!" & CntRef5.Address & _
",3)=""SME""))")
' which produces the string
=SUMPRODUCT(--(LEFT('[Release Plan
(1,2,3,4).xls]Sheet1'!$B$9:$B$50,3)="SME"))

Now Test it with Evaluate
? Evaluate("=SUMPRODUCT(--(LEFT('[Release Plan (1,2,3,4).xls]" & _
ShtRef & "'!" & CntRef5.Address & _
",3)=""SME""))")
'Produces
4

Which is correct in my sheet.

--
Regards,
Tom Ogilvy








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
FINDING PARTIAL ENTRIES IN A CELL/ARRAY FARAZ QURESHI Excel Discussion (Misc queries) 1 January 29th 09 12:06 AM
Summing partial strings. [email protected] Excel Worksheet Functions 4 October 8th 05 11:32 AM
Finding Partial Text in a Cell bob Excel Worksheet Functions 6 December 18th 04 05:03 AM
Finding strings within strings Rod[_6_] Excel Programming 1 December 2nd 03 05:34 PM
Finding strings within strings Rod[_6_] Excel Programming 1 December 2nd 03 05:19 PM


All times are GMT +1. The time now is 10:09 PM.

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"