Count of Charecters in a Cell

lprabhu1107

Board Regular
Joined
Mar 10, 2011
Messages
106
Hi Experts

I have following weekdays in Column A

Monday as Mu, Tuesday as Tu....Sunday as Su

In Cell A1: Mo Tu We Th Fr Sa Su
In Cell A2: Mo We Fr Su
In Cell A3: Tu Th Sa
In Cell A4: Mo Th Su

In Cell A1: Each day is seperated by Space
In Cell A2: Between Mo and We there is 3 spaces i.e. One normal space and other two spaces left for Tu
In A4: Between Mo and Th there is 2 Normal spaces and 4 spaces alloted for Tu and We

In Cell B1 i need 7 as count, B2: Count as 4, B3: count as 3, B4: Count as 3.

Days do not get repeated in cell.

I hope i have expressed clearly. Any Solution pls...

Regards

Prabhu
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi,

this formula gives a different number in B1. For example in Cell B2 instead of 4 the result is 13.In cell B3 instead of 3 result is 15.
 
Upvote 0
try this idea
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Mo Tu We Th Fr Sa Su</td><td style="text-align: right;;">7</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">Mo We Fr Su</td><td style="text-align: right;;">4</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">Tu Th Sa</td><td style="text-align: right;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">Mo Th Su</td><td style="text-align: right;;">3</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet4</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B1</th><td style="text-align:left">{=SUM(<font color="Blue">IF(<font color="Red">MID(<font color="Green">A1,ROW(<font color="Purple">INDIRECT(<font color="Teal">"1:"&LEN(<font color="#FF00FF">A1</font>)</font>)</font>),1</font>)<>" ",1</font>)</font>)/2}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B2</th><td style="text-align:left">{=SUM(<font color="Blue">IF(<font color="Red">MID(<font color="Green">A2,ROW(<font color="Purple">INDIRECT(<font color="Teal">"1:"&LEN(<font color="#FF00FF">A2</font>)</font>)</font>),1</font>)<>" ",1</font>)</font>)/2}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B3</th><td style="text-align:left">{=SUM(<font color="Blue">IF(<font color="Red">MID(<font color="Green">A3,ROW(<font color="Purple">INDIRECT(<font color="Teal">"1:"&LEN(<font color="#FF00FF">A3</font>)</font>)</font>),1</font>)<>" ",1</font>)</font>)/2}</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B4</th><td style="text-align:left">{=SUM(<font color="Blue">IF(<font color="Red">MID(<font color="Green">A4,ROW(<font color="Purple">INDIRECT(<font color="Teal">"1:"&LEN(<font color="#FF00FF">A4</font>)</font>)</font>),1</font>)<>" ",1</font>)</font>)/2}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 
Upvote 0
I think this much simpler, non-array, formula should also work for you.

Excel Workbook
AB
1Mo Tu We Th Fr Sa Su7
2Mo We Fr Su4
3Tu Th Sa3
4Mo Th Su3
Days
 
Upvote 0
this is non array formula
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Mo Tu We Th Fr Sa Su</td><td style="text-align: right;;">7</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">Mo We Fr Su</td><td style="text-align: right;;">4</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">Tu Th Sa</td><td style="text-align: right;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">Mo Th Su</td><td style="text-align: right;;">3</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet4</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B1</th><td style="text-align:left">=LEN(<font color="Blue">SUBSTITUTE(<font color="Red">A1," ",""</font>)</font>)/2</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

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