#1
|
|||
|
|||
count w and write into another column in excel
Hi all Last edited by tomlam; 10-02-2012 at 06:39 PM. |
#2
|
||||
|
||||
You can do this with a forumula:
=(LEN(B2)-LEN(SUBSTITUTE(B2,"1w","")))*1+(LEN(B2)-LEN(SUBSTITUTE(B2,"2w","")))*2+(LEN(B2)-LEN(SUBSTITUTE(B2,"3w","")))*3+(LEN(B2)-LEN(SUBSTITUTE(B2,"4w","")))*4+(LEN(B2)-LEN(SUBSTITUTE(B2,"5w","")))*5+(LEN(B2)-LEN(SUBSTITUTE(B2,"6w","")))*6+(LEN(B2)-LEN(SUBSTITUTE(B2,"7w","")))*7+(LEN(B2)-LEN(SUBSTITUTE(B2,"8w","")))*8 where the data are in B2. The above formula caters for up to 8w - you can add more expressions if you need. Note that I haven't bothered adding the 'w' to the formula results. You could do that with a custom number format (0w).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
sorry paul
after put the formula in column c, peter show 8(actual is 4) john show 8(actual is 4) tom show 28(actual is14) thanks |
#4
|
|||
|
|||
Hi Paul, thank you missing /2 .... now the formula workable
thank for your excellent knowledge =(LEN(B2)-LEN(SUBSTITUTE(B2,"1w","")))/2*1+(LEN(B2)-LEN(SUBSTITUTE(B2,"2w","")))/2*2+(LEN(B2)-LEN(SUBSTITUTE(B2,"3w","")))/2*3+(LEN(B2)-LEN(SUBSTITUTE(B2,"4w","")))/2*4+(LEN(B2)-LEN(SUBSTITUTE(B2,"5w","")))/2*5+(LEN(B2)-LEN(SUBSTITUTE(B2,"6w","")))*/2*6+(LEN(B2)-LEN(SUBSTITUTE(B2,"7w","")))/2*7+(LEN(B2)-LEN(SUBSTITUTE(B2,"8w","")))/2*8 |
#5
|
||||
|
||||
Simpler:
=((LEN(B2)-LEN(SUBSTITUTE(B2,"1w","")))*1+(LEN(B2)-LEN(SUBSTITUTE(B2,"2w","")))*2+(LEN(B2)-LEN(SUBSTITUTE(B2,"3w","")))*3+(LEN(B2)-LEN(SUBSTITUTE(B2,"4w","")))*4+(LEN(B2)-LEN(SUBSTITUTE(B2,"5w","")))*5+(LEN(B2)-LEN(SUBSTITUTE(B2,"6w","")))*6+(LEN(B2)-LEN(SUBSTITUTE(B2,"7w","")))*7+(LEN(B2)-LEN(SUBSTITUTE(B2,"8w","")))*8)/2
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
yes it is more simpler Thanks Paul
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to write the degree, minute second format in excel | Jamal NUMAN | Excel | 12 | 07-09-2018 11:44 PM |
Is it possible to write down a number starting with zero in excel cell? | Rahmat_uk20 | Excel | 3 | 06-08-2012 02:26 AM |
Read text Report file with VBA and write parsed fields to Excel workbook | tpcervelo | Excel Programming | 1 | 01-05-2012 10:14 PM |
Word Count in Excel | dallas | Excel | 1 | 11-23-2011 09:20 AM |
Count in Excel | zanat0s | Excel | 3 | 06-09-2011 10:53 AM |