Help adjusting sumproduct formula

michaelsmith559

Well-known Member
Joined
Oct 6, 2013
Messages
881
Office Version
  1. 2013
  2. 2007
In column A & column B I have the cells filled with combinations, ex (1, 2, 3, 4, 5) etc. I used a formula to count all the values in position 1 which works great after receiving help on a different post. When I adjust the formula to account for counting the character in position 2, it counts it incorrectly. Some characters may have 20 in that position and I think it is only counting the 2 not the 20. Here are the formulas I have tried. Also, sumproduct works fine on doing the first character in the string. It is just not working correctly when I try adjusting to count the 2nd character in the string.

mm combinations.xlsm
ABAC
39802195810
4235420
Sheet2
Cell Formulas
RangeFormula
AC3AC3=SUMPRODUCT(--(LEFT(RIGHT(A:A,LEN(A:A)-3),FIND(",",RIGHT(A:A,LEN(A:A)-3))-1)=N4&""))
AC4AC4=SUMPRODUCT(--((MID(A:A,4,LEN(N4)))=N4&"")+((MID(B:B,4,LEN(N4)))=N4&""))
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I think that it would be helpful to see a small sample of data (say 10-15 rows) from columns A and B, what the existing formulas result in and the expected results. You can hide all the columns between column B and column AB before producing your XL2BB mini sheet.
 
Upvote 0

Forum statistics

Threads
1,214,996
Messages
6,122,636
Members
449,092
Latest member
bsb1122

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