Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jordan
 
Posts: n/a
Default Understanding a formula

I posted a question earlier and I think my final question got lost. I'm
using the following formula to count the number of letters in a cell:

=SUMPRODUCT(LEN(SUBSTITUTE(A22,{0;1;2;3;4;5;6;7;8; 9},"")))-9*LEN(A22)

You all were kind enough to explain how the functions work but I still dont
understand why you subtract 1 less than the number of arguments in the
substitute formula and then multiple it by the lenght.

Thanks again for all you help.
  #2   Report Post  
Alok
 
Posts: n/a
Default

I will use the notation N to mean the number of characters in the cell and
n(x) to mean the number of charactes of type x that is n(3) wll be the number
of 3s.

The first number will be N-n(0)
The second number will be N-n(1)
The last number will be N-n(0)
If you total all these you get 10N - n(0)-n(1)-n(2)....-N(9)
If you take away 9N from the above you get N - n(0)-n(1)-n(2)....-N(9) which
is the desired number.

Alok Joshi


"Jordan" wrote:

I posted a question earlier and I think my final question got lost. I'm
using the following formula to count the number of letters in a cell:

=SUMPRODUCT(LEN(SUBSTITUTE(A22,{0;1;2;3;4;5;6;7;8; 9},"")))-9*LEN(A22)

You all were kind enough to explain how the functions work but I still dont
understand why you subtract 1 less than the number of arguments in the
substitute formula and then multiple it by the lenght.

Thanks again for all you help.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i write a formula and keep in in formula form, so it DOESN. norcalchick2207 Excel Discussion (Misc queries) 2 February 4th 05 08:38 PM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM
Understanding net present value formula in Excel kathy304 Excel Worksheet Functions 1 February 1st 05 07:15 PM
revert formula insertion to old method Don't be a pain in the ass Setting up and Configuration of Excel 0 January 24th 05 01:49 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM


All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"