Count # of Digits in a CEll

hrayani

Well-known Member
Joined
Jul 23, 2010
Messages
1,519
Office Version
  1. 2016
Platform
  1. Windows
Hello To All,

Is there any formula which can count the number of digits in a cell - whether the cell is a manually entered value or a formula result.

For Example

Cell Value = 568793
# of Digits Are (6)

Awaiting reply.

Best Regards,

Humayun Rayani
 
Dear Sachin

Thanks for the reply... i really appreciate..

But, dear i failed to understand what are you trying to say...

the formula which brother repairman615 just posted is working just perfect..
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Code:
What if 
Cell A1 = 12589
Cell B2 = 97621

Same results? 
<!-- / message --><!-- sig -->

In this case
the formula for matching digits should show (129)
the formula for Unique digits should show (5678)
 
Upvote 0
for previous Post time was same !

Check out !

=IF(FIND("1",A1,1)=FIND("1",B1,1),1,1)&IF(FIND("2",A1,1)=FIND("2",B1,1),2,2)

Note :- I have added only two number but
You should have add the more if condition in formula for the next numbers
 
Upvote 0
This may take me some time to figure out. Hopefully Aladin will also have a wonderful solution as I am unsure if I will be able to provide this.

If not tonight (today for you), then possible tomorrow.

Regards,
 
Upvote 0
<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=64 x:str><COLGROUP><COL style="WIDTH: 48pt" width=64><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17 width=64>Dear Repairman615</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17></TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>Thanks dear... you take your time</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17></TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>Dear Sachin,</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17></TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>Dear i tried your formula</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>i entered 2156 in cell A1</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>& 1256 in cell B1</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17></TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>then</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17></TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>i entered your formula in cell C1 without adding anymore (if conditions)</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>the result i am getting is 12 which is just perfect</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" height=17></TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>but, as soon as the value of Cell A1 is changed to 15689</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>then the answer is showing error (#Value)</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" height=17></TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl22 height=17>Any idea what to do now</TD></TR></TBODY></TABLE>
 
Upvote 0
Sachin.Medhe,

Very nice,

This is expanded from your idea which should do for the first part:


=IF(ISERR(FIND("0",A1,1)=FIND("0",B2,1)),"",0)&IF(ISERR(FIND("1",A1,1)=FIND("1",B2,1)),"",1)&IF(ISERR(FIND("2",A1,1)=FIND("2",B2,1)),"",2)&IF(ISERR(FIND("3",A1,1)=FIND("3",B2,1)),"",4)&IF(ISERR(FIND("4",A1,1)=FIND("4",B2,1)),"",5)&IF(ISERR(FIND("6",A1,1)=FIND("6",B2,1)),"",6)&IF(ISERR(FIND("7",A1,1)=FIND("7",B2,1)),"",7)&IF(ISERR(FIND("8",A1,1)=FIND("8",B2,1)),"",8)&IF(ISERR(FIND("9",A1,1)=FIND("9",B2,1)),"",9)
 
Upvote 0
Update:

=IF(ISERR(FIND("0",A1,1)=FIND("0",B2,1)),"",0)&IF(ISERR(FIND("1",A1,1)=FIND("1",B2,1)),"",1)&IF(ISERR(FIND("2",A1,1)=FIND("2",B2,1)),"",2)&IF(ISERR(FIND("3",A1,1)=FIND("3",B2,1)),"",3)&IF(ISERR(FIND("4",A1,1)=FIND("4",B2,1)),"",4)&IF(ISERR(FIND("5",A1,1)=FIND("5",B2,1)),"",5)&IF(ISERR(FIND("6",A1,1)=FIND("6",B2,1)),"",6)&IF(ISERR(FIND("7",A1,1)=FIND("7",B2,1)),"",7)&IF(ISERR(FIND("8",A1,1)=FIND("8",B2,1)),"",8)&IF(ISERR(FIND("9",A1,1)=FIND("9",B2,1)),"",9)
 
Upvote 0
Dear repairman615

Thanks the problem is solved now... initially i failed to understand sachin's formula..

Thanks Sachin for your time

now mathcing digits problem is solved ...

is there anything which could be done to this formula - i mean i bit of modification to solve the UNIQUE digits matter???
 
Upvote 0

Forum statistics

Threads
1,224,575
Messages
6,179,637
Members
452,934
Latest member
Jdsonne31

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