Thread: Len
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Len

It doesn't look like you need any of the =sum()'s. Keep the ()'s, though.

And len("D") can be replaced by 1

And there doesn't seem to be much reason to divide by 1.

=(LEN(C8)-LEN(SUBSTITUTE(C8,"D","")))
+(LEN(C12)-LEN(SUBSTITUTE(C12,"D","")))
+(LEN(C16)-LEN(SUBSTITUTE(C16,"D","")))
+(LEN(C20)-LEN(SUBSTITUTE(C20,"D","")))

You really don't need the () around each addend.

=LEN(C8)-LEN(SUBSTITUTE(C8,"D",""))
+LEN(C12)-LEN(SUBSTITUTE(C12,"D",""))
+LEN(C16)-LEN(SUBSTITUTE(C16,"D",""))
+LEN(C20)-LEN(SUBSTITUTE(C20,"D",""))

And you could actually concatenate the values in the cell, too:

=LEN(C8&C12&C16&C20)-LEN(SUBSTITUTE(C8&C12&C16&C20,"D",""))



Snit wrote:

Does anyone know how to simplify the following eqution in Excel?

=SUM(LEN(C8)-LEN(SUBSTITUTE(C8,"D","")))/LEN("D")+SUM(LEN(C12)-LEN(SUBSTITUTE(C12,"D","")))/LEN("D")+SUM(LEN(C16)-LEN(SUBSTITUTE(C16,"D","")))/LEN("D")+SUM(LEN(C20)-LEN(SUBSTITUTE(C20,"D","")))/LEN("D")

Thanks for the help.

--
Snit


--

Dave Peterson