Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Sumproduct error

Hello group,

I want to place in a cell C8 with VBA the statement
=Sumproduct((G3:G2500="w")*1)

Range("C8") = "=Sumproduct((G3:G2500="w")*1)"
Compile error, Expected: end of statement

Obviously, the inverted commas around w are causing the problem.
Is there a solution for this ?

I have a workaround of putting "w" in F1 and referencing F1 instead of
"w"

Thanks,

Michael Singmin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Sumproduct error

Michael Singmin wrote:
Range("C8") = "=Sumproduct((G3:G2500="w")*1)"
Compile error, Expected: end of statement

Obviously, the inverted commas around w are causing the problem.
Is there a solution for this ?


Range("C8") = "=Sumproduct((G3:G2500=""w"")*1)"

ie to include a " in a quoted string, insert ""

Is there a good reason not to use
"=COUNTIF(G3:G2500,""w"")"
?

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Sumproduct error

try ""w""

Gareth
"Michael Singmin" wrote in message
...
Hello group,

I want to place in a cell C8 with VBA the statement
=Sumproduct((G3:G2500="w")*1)

Range("C8") = "=Sumproduct((G3:G2500="w")*1)"
Compile error, Expected: end of statement

Obviously, the inverted commas around w are causing the problem.
Is there a solution for this ?

I have a workaround of putting "w" in F1 and referencing F1 instead of
"w"

Thanks,

Michael Singmin



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Sumproduct error

Thanks Gareth and Bill,

I could have sworn I tried the "" and it gave an error.

Bill, I am using Sumproduct because I am looking up 3 criteria
of which the ""w"" is one.

Thanks,

Michael
=================================================
"Gareth" wrote:

try ""w""

Gareth
"Michael Singmin" wrote in message
.. .
Hello group,

I want to place in a cell C8 with VBA the statement
=Sumproduct((G3:G2500="w")*1)

Range("C8") = "=Sumproduct((G3:G2500="w")*1)"
Compile error, Expected: end of statement

Obviously, the inverted commas around w are causing the problem.
Is there a solution for this ?

I have a workaround of putting "w" in F1 and referencing F1 instead of
"w"

Thanks,

Michael Singmin



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
#N/A error in sumproduct Paul C Excel Discussion (Misc queries) 0 December 9th 09 10:33 PM
SUMPRODUCT ERROR ColleenK Excel Discussion (Misc queries) 8 October 29th 09 06:31 PM
SUMPRODUCT Error Kate Excel Discussion (Misc queries) 5 June 25th 08 02:37 PM
SUMPRODUCT with #VALUE error Joe Gieder Excel Worksheet Functions 3 December 12th 07 07:09 PM
Sumproduct #num error Dominique Feteau Excel Worksheet Functions 2 December 19th 04 09:43 PM


All times are GMT +1. The time now is 06:19 AM.

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

About Us

"It's about Microsoft Excel"