+ Reply to Thread
Results 1 to 3 of 3

Substitute and Array Function

  1. #1
    Registered User
    Join Date
    02-24-2011
    Location
    Cape Town
    MS-Off Ver
    Excel 2003
    Posts
    2

    Angry Substitute and Array Function

    Hi there, I'd like to know how the formula below is equal to the anwer below?

    I'm not sure what the Substitute function does in the query below? I know the outer query is an array.

    Problem:

    Value of G2: 179736

    Formula: =SUM((LEN(SUBSTITUTE(G2,{1,2,3,4,5,6,7,8,9},"")))*{1,2,3,4,5,6,7,8,9})

    Answer: 237

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Substitute and Array Function

    It takes number 179736 and then replace every number with nothing and look LEN of it:

    Number 1 (79736) ---> 5
    Number 2 (179736) ---> 6
    Number 3 (17976) ---> 5
    Number 4 (179736) ---> 6
    Number 5 (179736) ---> 6
    Number 6 (17973) ---> 5
    Number 7 (1936) ---> 4
    Number 8 (179736) ---> 6
    Number 9 (17736) ---> 5

    Then it multiply it with numbers 1,2,3 etc

    (5,6,5,6,6,5,4,6,5) * (1,2,3,4,5,6,7,8,9)
    =(5,12,15,24,30,30,28,48,45)

    And SUM it 237

  3. #3
    Registered User
    Join Date
    02-24-2011
    Location
    Cape Town
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Substitute and Array Function

    Thank you so much!!!! And thanx for the nice explanation!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1