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?
ArvindPlease Login or Register to view this content.
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?
ArvindPlease Login or Register to view this content.
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.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
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.
I was wondering y do I get " unable to record" option=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")
Thanks again..
Arvind
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!
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
Ok then :-
Please Login or Register to view this content.
Arvind, perhaps you could use:
The above will return a Null if the base formula returned an Error.=LOOKUP(REPT("Z",255),CHOOSE({1,2},"",TRIM(LEFT(AK2,1)&" "&REPLACE(AK2,1,FIND("#",SUBSTITUTE(AK2," ","#",LEN(AK2)-LEN(SUBSTITUTE(AK2," ","")))),"")&" INT")))
Last edited by DonkeyOte; 06-20-2009 at 02:22 AM. Reason: revised to add handler with Null return
Hi,
Perfect, all the formulas are working
Thank you all
Arvind
Maybe:
Please Login or Register to view this content.
Ben Van Johnson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks