How to count last number

  • Thread starter Thread starter Terry M
  • Start date Start date
T

Terry M

I have numbers in columns labeled a through d. I would like to be able to
count the last digits in the numbers. Any ideas would be greatly
appreciated.

A B C D 1 2 3 4 5
6
93 86 21 83 2
1


Terry
 
Hi Terry,

Assuming you data start on row 2 and you have headings on row 1, with the
number 'count' headings starting in E1, try:
=SUM(IF(MOD($A2:$D2,10)=E$1,1,))
as an array formula in E2, copied down/across as far as needed.

FWIW, array formulae are input with <Ctrl-Shift-Enter>, instead of just
<Enter>

Cheers
 
Minor enhancement to disregard empty cells:
=SUM(IF((MOD($A2:$D2,10)=E$1)*($A2:$D2<>""),1,))

Cheers

--
macropod
[MVP - Microsoft Word]


macropod said:
Hi Terry,

Assuming you data start on row 2 and you have headings on row 1, with the
number 'count' headings starting in E1, try:
=SUM(IF(MOD($A2:$D2,10)=E$1,1,))
as an array formula in E2, copied down/across as far as needed.

FWIW, array formulae are input with <Ctrl-Shift-Enter>, instead of just
<Enter>

Cheers

--
macropod
[MVP - Microsoft Word]


Terry M said:
I have numbers in columns labeled a through d. I would like to be able to
count the last digits in the numbers. Any ideas would be greatly
appreciated.

A B C D 1 2 3 4 5
6
93 86 21 83 2
1


Terry
 
Thanks, I'll give it a try and let you know. Thanks again.
Terry said:
Minor enhancement to disregard empty cells:
=SUM(IF((MOD($A2:$D2,10)=E$1)*($A2:$D2<>""),1,))

Cheers

--
macropod
[MVP - Microsoft Word]


macropod said:
Hi Terry,

Assuming you data start on row 2 and you have headings on row 1, with the
number 'count' headings starting in E1, try:
=SUM(IF(MOD($A2:$D2,10)=E$1,1,))
as an array formula in E2, copied down/across as far as needed.

FWIW, array formulae are input with <Ctrl-Shift-Enter>, instead of just
<Enter>

Cheers

--
macropod
[MVP - Microsoft Word]


Terry M said:
I have numbers in columns labeled a through d. I would like to be able to
count the last digits in the numbers. Any ideas would be greatly
appreciated.

A B C D 1 2 3 4 5
6
93 86 21 83 2
1


Terry
 
It didn't work, I kept getting a value error. It seemed ok when I clicked on
the fx button to evaluate the formula, but not on the sheet.

macropod said:
Minor enhancement to disregard empty cells:
=SUM(IF((MOD($A2:$D2,10)=E$1)*($A2:$D2<>""),1,))

Cheers

--
macropod
[MVP - Microsoft Word]


macropod said:
Hi Terry,

Assuming you data start on row 2 and you have headings on row 1, with the
number 'count' headings starting in E1, try:
=SUM(IF(MOD($A2:$D2,10)=E$1,1,))
as an array formula in E2, copied down/across as far as needed.

FWIW, array formulae are input with <Ctrl-Shift-Enter>, instead of just
<Enter>

Cheers

--
macropod
[MVP - Microsoft Word]


Terry M said:
I have numbers in columns labeled a through d. I would like to be able to
count the last digits in the numbers. Any ideas would be greatly
appreciated.

A B C D 1 2 3 4 5
6
93 86 21 83 2
1


Terry
 
I found a way to do it. I took your formula and put a -- in from of the
MOD. I tried it in individual cells and it worked great, haven't tried it as
an array formula yet. Thanks, your help was greatly appreciated.

Terry

Tmaxx02 said:
Thanks, I'll give it a try and let you know. Thanks again.
Terry said:
Minor enhancement to disregard empty cells:
=SUM(IF((MOD($A2:$D2,10)=E$1)*($A2:$D2<>""),1,))

Cheers

--
macropod
[MVP - Microsoft Word]


macropod said:
Hi Terry,

Assuming you data start on row 2 and you have headings on row 1, with
the
number 'count' headings starting in E1, try:
=SUM(IF(MOD($A2:$D2,10)=E$1,1,))
as an array formula in E2, copied down/across as far as needed.

FWIW, array formulae are input with <Ctrl-Shift-Enter>, instead of just
<Enter>

Cheers

--
macropod
[MVP - Microsoft Word]


I have numbers in columns labeled a through d. I would like to be
able to
count the last digits in the numbers. Any ideas would be greatly
appreciated.

A B C D 1 2 3 4
5
6
93 86 21 83 2
1


Terry
 
Hi Terry,

Putting '--' before MOD in the formula won't make any difference - it will
return the correct result regardless.

Putting '--' before E$1 in the formula will make a difference, but only if
the 'lookup' value on row 1 has been input as text instead of as a number.

Either way, the formula won't work at all unless you input it as an array
formula.

Cheers

--
macropod
[MVP - Microsoft Word]


Terry M said:
I found a way to do it. I took your formula and put a -- in from of the
MOD. I tried it in individual cells and it worked great, haven't tried it as
an array formula yet. Thanks, your help was greatly appreciated.

Terry

Tmaxx02 said:
Thanks, I'll give it a try and let you know. Thanks again.
Terry said:
Minor enhancement to disregard empty cells:
=SUM(IF((MOD($A2:$D2,10)=E$1)*($A2:$D2<>""),1,))

Cheers

--
macropod
[MVP - Microsoft Word]


Hi Terry,

Assuming you data start on row 2 and you have headings on row 1, with
the
number 'count' headings starting in E1, try:
=SUM(IF(MOD($A2:$D2,10)=E$1,1,))
as an array formula in E2, copied down/across as far as needed.

FWIW, array formulae are input with <Ctrl-Shift-Enter>, instead of just
<Enter>

Cheers

--
macropod
[MVP - Microsoft Word]


I have numbers in columns labeled a through d. I would like to be
able
to
count the last digits in the numbers. Any ideas would be greatly
appreciated.

A B C D 1 2 3 4
5
6
93 86 21 83 2
1


Terry
 
I don't know much about it, but I modified it to work on one cell. Either
way, I got it to work the way I want it to. Thanks very much.

macropod said:
Hi Terry,

Putting '--' before MOD in the formula won't make any difference - it will
return the correct result regardless.

Putting '--' before E$1 in the formula will make a difference, but only if
the 'lookup' value on row 1 has been input as text instead of as a number.

Either way, the formula won't work at all unless you input it as an array
formula.

Cheers

--
macropod
[MVP - Microsoft Word]


Terry M said:
I found a way to do it. I took your formula and put a -- in from of the
MOD. I tried it in individual cells and it worked great, haven't tried it as
an array formula yet. Thanks, your help was greatly appreciated.

Terry

Tmaxx02 said:
Thanks, I'll give it a try and let you know. Thanks again.
Terry
macropod wrote:
Minor enhancement to disregard empty cells:
=SUM(IF((MOD($A2:$D2,10)=E$1)*($A2:$D2<>""),1,))

Cheers

--
macropod
[MVP - Microsoft Word]


Hi Terry,

Assuming you data start on row 2 and you have headings on row 1,
with
the
number 'count' headings starting in E1, try:
=SUM(IF(MOD($A2:$D2,10)=E$1,1,))
as an array formula in E2, copied down/across as far as needed.

FWIW, array formulae are input with <Ctrl-Shift-Enter>, instead of just
<Enter>

Cheers

--
macropod
[MVP - Microsoft Word]


I have numbers in columns labeled a through d. I would like to be
able
to
count the last digits in the numbers. Any ideas would be greatly
appreciated.

A B C D 1 2 3 4
5
6
93 86 21 83 2
1


Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top