How many digits and letters a cell has; change small letters to capital.

snd

New Member
Joined
Jan 24, 2010
Messages
44
Excel 2007
Row\Col
A
B
C
D
E
F
G
1
Original Data​
New Data​
Digits​
Letters​
2
XYz123456XYZ123456
6​
3​
3
aB1234567AB1234567
7​
2​
4
123456780​
123456780​
9​
0​
5
6
7
8
Notes:
9
- Letters + Digits = 9 characters, always.
10
- Number of digits are always between 6 and 9 (inclusive).
11
(so, number of letters are always between zero and three).
12
- Letters come before numbers.
13
14
1- I need to change the small letters to capital.
15
2- I need to know how many numbers, and how many letters (if any) in each cell.
16
17
Notes:
18
Please, worksheet functions only.

<tbody>
</tbody>
Sheet: Sheet1

<tbody>
</tbody>

Thank you guys for helping me out.:)
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Numbers
Code:
=LEN(B2)-LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,0,""),1,""),2,""),3,""),4,""),5,""),6,""),7,""),8,""),9,""))

Letters
Code:
=LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,0,""),1,""),2,""),3,""),4,""),5,""),6,""),7,""),8,""),9,""))

Uppercase
Code:
=UPPER(A2)
 
  • Like
Reactions: snd
Upvote 0
Numbers
Code:
=LEN(B2)-LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2,0,""),1,""),2,""),3,""),4,""),5,""),6,""),7,""),8,""),9,""))

Thank you very much nonexistence for your help.(y)
 
Upvote 0
Number of non-numeric characters in A1 =SUMPRODUCT(--ISERROR(0+("0"&MID(A1,ROW(1:255),1))))

Number of numeric digits in A1 =SUMPRODUCT(--ISNUMBER(0+(MID(A1,ROW(1:255),1))))
 
Last edited:
  • Like
Reactions: snd
Upvote 0
Thank you Mike very much. If I may ask another one: Where can I find more info about "Sumproduct". (didn't understand the zero before the MID Function).
 
Upvote 0
Hi Ppgc01

I am always interested in your formulae so looked more closely at your suggestion for D1 - surely to capture all of the potential "numbers" it should have been:

=SUM(1-ISNUMBER(-MID(A1,{1,2,3,4,5,6,7,8,9},1)))

edvwvw
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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