Formulas Returning Wrong Values

CARBOB

Well-known Member
Joined
Jun 6, 2005
Messages
1,870
Will someone please tell me why the formulas in G:K are returning wrong values. They are suppose to count how many of the values in B:F repeat. I think it may be a format problem, but can't find it.








Book1
ABCDEFGHIJK
1412345
1512/30/16031417253611111
1612/29/16030513233611111
1712/28/16071422343511111
1812/27/16050913151711111
1912/26/16132630333611111
LAST DIGIT (2)
 
Oooh, nice trick - thanks for that! :)

Doesn't work here in Firefox: I just get an empty message box. :(

Try with the A/A icon (switch editor) highlighted :)
 
Last edited:
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
CARBOB, Good afternoon.

Are you wanting to count how many times the digit 1 appears in the 5 numbers on the same line?

If so, try using this formula.

G15 --> =SUMPRODUCT(--((LEN($B15:$F15)-LEN(SUBSTITUTE($B15:$F15, G$14, ""))) / LEN(G$14)))

Copy it to the right and down.

Is that what you want?
I hope it helps.
 
Last edited:
Upvote 0
thank you.

Finally figured out how to post the code. I have Excel 2016 and it is a lot different than 2007.

sorry for all the confusion and the formula is suppose to be entered CSE. Thanks for all the help.


Book1
ABCDEFGHIJK
1412345
1512/30/16031417253623444
1612/29/16030513233602344
1712/28/16071422343500011
1812/27/16050913151711122
1912/26/16132630333601223
LAST DIGIT (2)
Cell Formulas
RangeFormula
G15{=SUMPRODUCT(IF(COUNTIF(OFFSET($B15,1,0,G$14,5),$B15:$F15)$B15:$F15,$B15:$F15),COUNTIF(OFFSET($B15,1,0,G$14,5),$B15:$F15)/COUNTIF($B15:$F15,$B15:$F15),1))}
G16{=SUMPRODUCT(IF(COUNTIF(OFFSET($B16,1,0,G$14,5),$B16:$F16)$B16:$F16,$B16:$F16),COUNTIF(OFFSET($B16,1,0,G$14,5),$B16:$F16)/COUNTIF($B16:$F16,$B16:$F16),1))}
G17{=SUMPRODUCT(IF(COUNTIF(OFFSET($B17,1,0,G$14,5),$B17:$F17)$B17:$F17,$B17:$F17),COUNTIF(OFFSET($B17,1,0,G$14,5),$B17:$F17)/COUNTIF($B17:$F17,$B17:$F17),1))}
G18{=SUMPRODUCT(IF(COUNTIF(OFFSET($B18,1,0,G$14,5),$B18:$F18)$B18:$F18,$B18:$F18),COUNTIF(OFFSET($B18,1,0,G$14,5),$B18:$F18)/COUNTIF($B18:$F18,$B18:$F18),1))}
G19{=SUMPRODUCT(IF(COUNTIF(OFFSET($B19,1,0,G$14,5),$B19:$F19)$B19:$F19,$B19:$F19),COUNTIF(OFFSET($B19,1,0,G$14,5),$B19:$F19)/COUNTIF($B19:$F19,$B19:$F19),1))}
H15{=SUMPRODUCT(IF(COUNTIF(OFFSET($B15,1,0,H$14,5),$B15:$F15)$B15:$F15,$B15:$F15),COUNTIF(OFFSET($B15,1,0,H$14,5),$B15:$F15)/COUNTIF($B15:$F15,$B15:$F15),1))}
H16{=SUMPRODUCT(IF(COUNTIF(OFFSET($B16,1,0,H$14,5),$B16:$F16)$B16:$F16,$B16:$F16),COUNTIF(OFFSET($B16,1,0,H$14,5),$B16:$F16)/COUNTIF($B16:$F16,$B16:$F16),1))}
H17{=SUMPRODUCT(IF(COUNTIF(OFFSET($B17,1,0,H$14,5),$B17:$F17)$B17:$F17,$B17:$F17),COUNTIF(OFFSET($B17,1,0,H$14,5),$B17:$F17)/COUNTIF($B17:$F17,$B17:$F17),1))}
H18{=SUMPRODUCT(IF(COUNTIF(OFFSET($B18,1,0,H$14,5),$B18:$F18)$B18:$F18,$B18:$F18),COUNTIF(OFFSET($B18,1,0,H$14,5),$B18:$F18)/COUNTIF($B18:$F18,$B18:$F18),1))}
H19{=SUMPRODUCT(IF(COUNTIF(OFFSET($B19,1,0,H$14,5),$B19:$F19)$B19:$F19,$B19:$F19),COUNTIF(OFFSET($B19,1,0,H$14,5),$B19:$F19)/COUNTIF($B19:$F19,$B19:$F19),1))}
I15{=SUMPRODUCT(IF(COUNTIF(OFFSET($B15,1,0,I$14,5),$B15:$F15)$B15:$F15,$B15:$F15),COUNTIF(OFFSET($B15,1,0,I$14,5),$B15:$F15)/COUNTIF($B15:$F15,$B15:$F15),1))}
I16{=SUMPRODUCT(IF(COUNTIF(OFFSET($B16,1,0,I$14,5),$B16:$F16)$B16:$F16,$B16:$F16),COUNTIF(OFFSET($B16,1,0,I$14,5),$B16:$F16)/COUNTIF($B16:$F16,$B16:$F16),1))}
I17{=SUMPRODUCT(IF(COUNTIF(OFFSET($B17,1,0,I$14,5),$B17:$F17)$B17:$F17,$B17:$F17),COUNTIF(OFFSET($B17,1,0,I$14,5),$B17:$F17)/COUNTIF($B17:$F17,$B17:$F17),1))}
I18{=SUMPRODUCT(IF(COUNTIF(OFFSET($B18,1,0,I$14,5),$B18:$F18)$B18:$F18,$B18:$F18),COUNTIF(OFFSET($B18,1,0,I$14,5),$B18:$F18)/COUNTIF($B18:$F18,$B18:$F18),1))}
I19{=SUMPRODUCT(IF(COUNTIF(OFFSET($B19,1,0,I$14,5),$B19:$F19)$B19:$F19,$B19:$F19),COUNTIF(OFFSET($B19,1,0,I$14,5),$B19:$F19)/COUNTIF($B19:$F19,$B19:$F19),1))}
J15{=SUMPRODUCT(IF(COUNTIF(OFFSET($B15,1,0,J$14,5),$B15:$F15)$B15:$F15,$B15:$F15),COUNTIF(OFFSET($B15,1,0,J$14,5),$B15:$F15)/COUNTIF($B15:$F15,$B15:$F15),1))}
J16{=SUMPRODUCT(IF(COUNTIF(OFFSET($B16,1,0,J$14,5),$B16:$F16)$B16:$F16,$B16:$F16),COUNTIF(OFFSET($B16,1,0,J$14,5),$B16:$F16)/COUNTIF($B16:$F16,$B16:$F16),1))}
J17{=SUMPRODUCT(IF(COUNTIF(OFFSET($B17,1,0,J$14,5),$B17:$F17)$B17:$F17,$B17:$F17),COUNTIF(OFFSET($B17,1,0,J$14,5),$B17:$F17)/COUNTIF($B17:$F17,$B17:$F17),1))}
J18{=SUMPRODUCT(IF(COUNTIF(OFFSET($B18,1,0,J$14,5),$B18:$F18)$B18:$F18,$B18:$F18),COUNTIF(OFFSET($B18,1,0,J$14,5),$B18:$F18)/COUNTIF($B18:$F18,$B18:$F18),1))}
J19{=SUMPRODUCT(IF(COUNTIF(OFFSET($B19,1,0,J$14,5),$B19:$F19)$B19:$F19,$B19:$F19),COUNTIF(OFFSET($B19,1,0,J$14,5),$B19:$F19)/COUNTIF($B19:$F19,$B19:$F19),1))}
K15{=SUMPRODUCT(IF(COUNTIF(OFFSET($B15,1,0,K$14,5),$B15:$F15)$B15:$F15,$B15:$F15),COUNTIF(OFFSET($B15,1,0,K$14,5),$B15:$F15)/COUNTIF($B15:$F15,$B15:$F15),1))}
K16{=SUMPRODUCT(IF(COUNTIF(OFFSET($B16,1,0,K$14,5),$B16:$F16)$B16:$F16,$B16:$F16),COUNTIF(OFFSET($B16,1,0,K$14,5),$B16:$F16)/COUNTIF($B16:$F16,$B16:$F16),1))}
K17{=SUMPRODUCT(IF(COUNTIF(OFFSET($B17,1,0,K$14,5),$B17:$F17)$B17:$F17,$B17:$F17),COUNTIF(OFFSET($B17,1,0,K$14,5),$B17:$F17)/COUNTIF($B17:$F17,$B17:$F17),1))}
K18{=SUMPRODUCT(IF(COUNTIF(OFFSET($B18,1,0,K$14,5),$B18:$F18)$B18:$F18,$B18:$F18),COUNTIF(OFFSET($B18,1,0,K$14,5),$B18:$F18)/COUNTIF($B18:$F18,$B18:$F18),1))}
K19{=SUMPRODUCT(IF(COUNTIF(OFFSET($B19,1,0,K$14,5),$B19:$F19)$B19:$F19,$B19:$F19),COUNTIF(OFFSET($B19,1,0,K$14,5),$B19:$F19)/COUNTIF($B19:$F19,$B19:$F19),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

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