Help fixing Sumproduct formula

michaelsmith559

Well-known Member
Joined
Oct 6, 2013
Messages
881
Office Version
  1. 2013
  2. 2007
Need help fixing the sumproduct formula. I'm trying to get it to use the values in column N but I've tried a couple of different ways and I get a #value error or I manually have to change the reference in the formula to the value shown in column N when it becomes a double digit such as 10. Columns u,v,&w are where I was trying different formulas. Below is a partial copy of the sheet. Thanks for any help.

Cell Formulas
RangeFormula
R2R2=T1-1048575
S2,S14:S15,S12,S10,S8,S6S2=(O2+R2)-1
R3:R16R3=S2+1
S16,S13,S11,S9,S7,S3:S5S3=(O3-($T$1-R3))-1
V2:V3V2=SUMPRODUCT(--(VALUE(MID(A:A,1,1))=N2)+(VALUE(MID(B:B,1,1))=N2))
V4V4=SUMPRODUCT(--((MID(F:F,1,2))="10")+((MID(G:G,1,2))="10"))
W4W4=SUMPRODUCT(--(VALUE(MID(F:F,1,2))=N11)+(VALUE(MID(G:G,1,2))=N11))
U2U2=VALUE(MID(A1,1,1))
U3U3=VALUE(MID(A1,4,1))
U4U4=VALUE(MID(A1,7,1))
U5U5=VALUE(MID(A1,10,1))
U6U6=VALUE(MID(A1,13,1))
O2:O3O2=SUMPRODUCT(--(LEFT(A:A,1)*1=N2)+(LEFT(B:B,1)*1=N2))
O4O4=SUMPRODUCT(--(LEFT(B:B,1)*1=N4)+(LEFT(C:C,1)*1=N4))
O5O5=SUMPRODUCT(--(LEFT(C:C,1)*1=N5)+(LEFT(D:D,1)*1=N5))
O6:O7O6=SUMPRODUCT(--(LEFT(D:D,1)*1=N6)+(LEFT(E:E,1)*1=N6))
O8:O10O8=SUMPRODUCT(--(LEFT(E:E,1)*1=N8)+(LEFT(F:F,1)*1=N8))
O11O11=SUMPRODUCT(--(LEFT(F:F,2)="10")+(LEFT(G:G,2)="10"))
O12O12=SUMPRODUCT(--(LEFT(G:G,2)="11")+(LEFT(H:H,2)="11"))
O13O13=SUMPRODUCT(--(LEFT(G:G,2)="12")+(LEFT(H:H,2)="12"))
O14O14=SUMPRODUCT(--(LEFT(H:H,2)="13")+(LEFT(I:I,2)="13"))
O15O15=SUMPRODUCT(--(LEFT(H:H,2)="14")+(LEFT(I:I,2)="14"))
O16O16=SUMPRODUCT(--(LEFT(H:H,2)="15")+(LEFT(I:I,2)="15"))
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
As you haven't shown the data the formula is using & haven't said what you are trying to do, the following is a total guess
Excel Formula:
=SUMPRODUCT(--(VALUE(left(A:A,len(N2)))=N2)+(VALUE(left(B:B,len(N2)))=N2))
 
Upvote 0
need to share the entire range for use to debug it for you
 
Upvote 0
As you haven't shown the data the formula is using & haven't said what you are trying to do, the following is a total guess
Excel Formula:
=SUMPRODUCT(--(VALUE(left(A:A,len(N2)))=N2)+(VALUE(left(B:B,len(N2)))=N2))
Sorry, I am counting the number of combinations that start with the value listed in column N. Here is a sample of what the values look like:

mm combinations.xlsm
AB
11, 2, 3, 4, 52, 7, 10, 41, 52
21, 2, 3, 4, 62, 7, 10, 41, 53
31, 2, 3, 4, 72, 7, 10, 41, 54
41, 2, 3, 4, 82, 7, 10, 41, 55
51, 2, 3, 4, 92, 7, 10, 41, 56
61, 2, 3, 4, 102, 7, 10, 41, 57
71, 2, 3, 4, 112, 7, 10, 41, 58
81, 2, 3, 4, 122, 7, 10, 41, 59
91, 2, 3, 4, 132, 7, 10, 41, 60
101, 2, 3, 4, 142, 7, 10, 41, 61
Sheet2


I tried the formula you gave and it gives the #value error as well. I don't understand how the formulas I'm trying work for single digit values in column n but not for double digits.
 
Upvote 0
You're getting problems because you are trying to convert values like 1, to a number, how about
Excel Formula:
=SUMPRODUCT((LEFT($A$1:$A$10,LEN(N1))=N1&"")+(LEFT($B$1:$B$10,LEN(N1))=N1&""))
 
Upvote 0
Solution
You're getting problems because you are trying to convert values like 1, to a number, how about
Excel Formula:
=SUMPRODUCT((LEFT($A$1:$A$10,LEN(N1))=N1&"")+(LEFT($B$1:$B$10,LEN(N1))=N1&""))
Thanks for the help. Works great!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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