+ Reply to Thread
Results 1 to 12 of 12

Adding a Hyperlink to a IF Formula ( with a twist )

  1. #1
    Registered User
    Join Date
    12-10-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    26

    Question Adding a Hyperlink to a IF Formula ( with a twist )

    Good Morning,

    I have done my best to search google for a answer but have come up with nothing that I can understand or use. Sorry I am pretty new...

    Utilizing a userform, users enter a series of entries into sheet 2 to of our log, it is a long string of data and not very user friendly. So I am using sheet 1 as a "cover page" to transfer some of the data over to allow for users to review entries using this formula (F1), I am using this formula (F2) to add a unique number to every entry so we can provide this number to other staff, customers etc. as a reference.

    (F1)=IF(Sheet2!B3 = ISBLANK(TRUE),"",Sheet2!B3)
    (F2)=IF(B4="","",CONCATENATE("CCR",LEFT("0000",4-LEN(ROW(A2)-1)),ROW(A2)-1))

    What I require is for (F2) to contain a hyperlink that brings it back to the correct row on sheet 2 for users to review all the data if required, this hyperlink will also be useful as I have to create another sheet for "follow up" if required.

    If I am missing any information that would help you to help me, please let me know.

    Many Thanks !

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    sorry but what info is on the sheet you are hyperlinking to ?could you post an example work book?
    but doesnt =if(b4="","",="CCR"&TEXT(ROWS($A$1:A1),"0000") give the same result as F2?
    Last edited by martindwilson; 12-10-2012 at 12:08 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    12-10-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    Hello,

    Here is my workbook. I am unsure if your formula does the same thing as mine took me awhile just to get mine right..
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    well it does!
    but where is the hyperlink to be created and where is its target?

  5. #5
    Registered User
    Join Date
    12-10-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    Using the work book. clicking on sheet 1 A4 should hyperlink you to row 3 on sheet 2 and so on.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    there is no ccr on sheet 2

  7. #7
    Registered User
    Join Date
    12-10-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    Quote Originally Posted by martindwilson View Post
    there is no ccr on sheet 2
    Correct, only contained on sheet 1, I need it to point to the row (as I stated above) I am still very neew with excel, please make any changes you see fit to get this to work, I am very open to new idea's

  8. #8
    Registered User
    Join Date
    12-10-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    Quote Originally Posted by martindwilson View Post
    sorry but what info is on the sheet you are hyperlinking to ?could you post an example work book?
    but doesnt =if(b4="","",="CCR"&TEXT(ROWS($A$1:A1),"0000") give the same result as F2?
    Took some time to check out the formula you provided, I received errors. I revamped it to this: =if(b4="","","CCR"&TEXT(ROWS($A$1:A1),"0000")) and it now does the same thing, may I ask is one better than the other, or is it just two ways to get the same result?

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    oops missed a ")"
    but what row? if agent 1 has 3 entries how could it be determined which one? you need some unique identifier

  10. #10
    Registered User
    Join Date
    12-10-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    Ok, I see where this may be confusing, I don't think I expalined exactly what I need.

    Let's use the workbook I provided.

    On Sheet 1 cell A4 it currently contains this formula: =IF(B4="","",CONCATENATE("CCR",LEFT("0000",4-LEN(ROW(A2)-1)),ROW(A2)-1))
    The bold text is what I want to act as the hyper link.
    Now, cell A4 will only populate if something is in cell B4, B4 uses this formula: =IF(Sheet2!B3 = ISBLANK(TRUE),"",Sheet2!B3)
    Bold text is where the hyper link should point to.
    So in conclusion, the hyperlink I require need to point cell A4 in Sheet 1 to cell B3 in sheet two, using the unique ID created by the IF formula.

    I hope that clears it up.
    Last edited by jampy00; 12-10-2012 at 04:58 PM. Reason: correction

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    maybe in sheet1!a4
    =IF(B4="","",HYPERLINK("#"&"sheet2!b"&ROWS($A$1:A3),"CCR"&TEXT(ROWS($A$1:A1),"0000")))

  12. #12
    Registered User
    Join Date
    12-10-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Adding a Hyperlink to a IF Formula ( with a twist )

    Quote Originally Posted by martindwilson View Post
    maybe in sheet1!a4
    =IF(B4="","",HYPERLINK("#"&"sheet2!b"&ROWS($A$1:A3),"CCR"&TEXT(ROWS($A$1:A1),"0000")))
    Works like a charm, I added to your reputation.

    Many Thanks !!

+ 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