+ Reply to Thread
Results 1 to 3 of 3

Iserror() not seem to be working

  1. #1
    Registered User
    Join Date
    03-13-2018
    Location
    Omaha,NE
    MS-Off Ver
    Office365
    Posts
    2

    Post Iserror() not seem to be working

    I have a client that posts social media items on a social media platform. He gets reports in Excel that show him a report including copy, clicks, shares, posts, date, time etc. The copy field sometimes contains the hyperlink that directs the reader to more information. He wants a way to filter out the hyperlink and just get the words of the copy.

    I wrote a formula for him but the iserror() doesn't trap the error. =IF(B1=1,MID(A1,30,LEN(A1)-29),IF(B1>1,MID(A1,1,B1-2),IF(ISERROR(B1),A1,"")))

    The copy is in column A and the hyperlink can be at the first of the copy, at the end of the copy, or no hyperlink at all.

    My formula tries to capture all three:

    First I find where the hyperlink starts using the find function: =FIND("http",A1,1) and plug the location number in column B.

    Then I have a formula that copies the copy without the hyperlink to column C,
    =IF(B1=1,MID(A1,30,LEN(A1)-29),IF(B1>1,MID(A1,1,B1-2),IF(ISERROR(B1),A1,"")))

    So
    if the link is at the first of the copy, column B will have the value of 1 and I use the mid function and copy everything after the link to column C.
    (The links are always the same length, so I am able to use hard numbers in the mid function)

    if the link is at the end of the copy, column B will be greater than the value of 1 and I use the mid function and copy everything before the link (excluding the space before link) to column C.

    This is where I run into problems.
    If the copy does not contain a link, column B has #value! in it and I want to copy the entire cell from column A into column C. I googled #value! and learned if I use the iserror() trap, I should be able to trap the error and copy the whole copy to column C but it only copyies #value!, not column A.

    What am I doing wrong? I have included an attachment that shows examples of what I am doing.

    Thanks for your help.
    CJ
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,907

    Re: Iserror() not seem to be working

    Try this ...

    =IF(ISERROR(B1),A1,IF(B1=1,MID(A1,30,LEN(A1)-29),MID(A1,1,B1-2)))

  3. #3
    Registered User
    Join Date
    03-13-2018
    Location
    Omaha,NE
    MS-Off Ver
    Office365
    Posts
    2

    Re: Iserror() not seem to be working

    Thank you!!! It worked. I didn't think Excel formula's were placement dependent.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ISERROR partially working
    By jimbokeep in forum Excel General
    Replies: 5
    Last Post: 11-18-2016, 12:03 PM
  2. [SOLVED] Why IF ISERROR not working?
    By unley in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-08-2016, 09:13 PM
  3. iserror not working
    By ammartino44 in forum Excel General
    Replies: 1
    Last Post: 09-17-2014, 04:39 PM
  4. #Value! iserror not working
    By loristask in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2014, 01:04 PM
  5. [SOLVED] IF(ISERROR Not Working
    By djfatboyfats in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-11-2013, 10:14 AM
  6. Vlookup and iserror not working properly
    By jchapm123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-03-2010, 12:33 AM
  7. iserror not working
    By megabytecomput in forum Excel General
    Replies: 2
    Last Post: 01-09-2009, 05:02 PM

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