Sumproduct, Left and #Value!

IanSavage

New Member
Joined
Mar 16, 2019
Messages
3
I'm trying to count how many times specific text (the first 4 characters in a cell) appear in a column. Each cell starts with a code e.g. RC30 and then will have varying text after.

I've tried VBA code

Code:
Worksheets("Sheet1").Range("D1").Value = Worksheets("Sheet1").Application.SumProduct(--(Left("A1:A21", 4) = "RC30"))

but in cell D1 where I want the answer, I get #Value !

Now I know I'm probably going about this all wrong, VBA is not my strong point but I do find it fascinating to use when I get the coding correct.

Any help / guidance will be appreciated.

Ian
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Phuoc

Active Member
Joined
Apr 29, 2016
Messages
284
Try:
Code:
Worksheets("Sheet1").Range("D1").Value = Evaluate("SumProduct(--(Left(A1:A21, 4) = ""RC30""))")
 

Watch MrExcel Video

Forum statistics

Threads
1,122,957
Messages
5,599,046
Members
414,281
Latest member
Engjamal2021

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top