+ Reply to Thread
Results 1 to 9 of 9

unable to record a formula as its too long

  1. #1
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    unable to record a formula as its too long

    Hi,

    I tried recording this formula I am not able to record as system prompts me "Unable to Record"
    How Do i write this formula in a code?

    Please Login or Register  to view this content.
    Arvind

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: unable to record a formula as its too long

    Arvind, I could sit here for a while working this through but in essence you seem to be trying to pick up a given word from within a string, care to post an example of what you're doing ?

    As a general pointer - when you have a lengthy formulae and want to error trap you can avoid the double evaluation by using LOOKUP in conjunction with CHOOSE (when you're returning a consistent data type as is the case here (string))

    LOOKUP(REPT("Z",255),CHOOSE({1,2},"",your formula))

    BUT that said I suspect we can dramatically shorten your formula ... need some samples first though to be sure.

  3. #3
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Re: unable to record a formula as its too long

    Hi,

    Thanks for your reply
    I have the value in sheet "Import" and in cell Ak2 as "Leonard Berly"

    my result in AL2 should be L Berly INT
    that is First letter of the Firstname & full lastname and a word INT
    So If i input the below formula I get the result, if error it result blank.

    =IF(ISERROR(LEFT(Import!AK2,1)&" "&LEFT(RIGHT(Import!AK2,LEN(Import!AK2)-FIND(" ",Import!AK2,1)),FIND(" ",RIGHT(Import!AK2,LEN(Import!AK2)-FIND(" ",Import!AK2,1)),1))&"INT"),"",LEFT(Import!AK2,1)&" "&LEFT(RIGHT(Import!AK2,LEN(Import!AK2)-FIND(" ",Import!AK2,1)),FIND(" ",RIGHT(Import!AK2,LEN(Import!AK2)-FIND(" ",Import!AK2,1)),1))&" INT")
    I was wondering y do I get " unable to record" option

    Thanks again..

    Arvind

  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: unable to record a formula as its too long

    Does this work for you?

    =IF(B4="","",SUBSTITUTE(B4,MID(B4,2,FIND(" ",B4&" ")-2),"")&" INT")
    Last edited by squiggler47; 06-20-2009 at 01:54 AM. Reason: oops, was trying something else changes formula
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  5. #5
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Re: unable to record a formula as its too long

    Hi,

    Thanks for you help.
    The formula works fine when there are only 2 words in Cell B4,
    like Alan David But if the name is Alan David Jone then the formula results A David Jones Int
    The result required is A David Int

    Thanks
    Arvind

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: unable to record a formula as its too long

    Ok then :-

    Please Login or Register  to view this content.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: unable to record a formula as its too long

    Arvind, perhaps you could use:

    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",TRIM(LEFT(AK2,1)&" "&REPLACE(AK2,1,FIND("#",SUBSTITUTE(AK2," ","#",LEN(AK2)-LEN(SUBSTITUTE(AK2," ","")))),"")&" INT")))
    The above will return a Null if the base formula returned an Error.
    Last edited by DonkeyOte; 06-20-2009 at 02:22 AM. Reason: revised to add handler with Null return

  8. #8
    Forum Contributor
    Join Date
    03-28-2008
    Location
    India, bangalore
    MS-Off Ver
    Excel 2003,2007
    Posts
    216

    Re: unable to record a formula as its too long

    Hi,

    Perfect, all the formulas are working

    Thank you all

    Arvind

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,624

    Re: unable to record a formula as its too long

    Maybe:

    Please Login or Register  to view this content.
    Ben Van Johnson

+ 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