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
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try:
Code:
Worksheets("Sheet1").Range("D1").Value = Evaluate("SumProduct(--(Left(A1:A21, 4) = ""RC30""))")
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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
Back
Top