Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
#N/A error in sumproduct | Excel Discussion (Misc queries) | |||
SUMPRODUCT ERROR | Excel Discussion (Misc queries) | |||
SUMPRODUCT Error | Excel Discussion (Misc queries) | |||
SUMPRODUCT with #VALUE error | Excel Worksheet Functions | |||
Sumproduct #num error | Excel Worksheet Functions |