Documentation/Calc Functions/HYPERLINK

    From The Document Foundation Wiki
    Other languages:


    Function name:

    HYPERLINK

    Category:

    Spreadsheet

    Summary:

    Constructs a clickable text hyperlink in the formula cell. When the hyperlink is clicked, Calc opens the specified resource (often in another application) or moves to the specified location in the current spreadsheet.

    By default, the formula cell displays the link target as a text string but a more user-friendly text string can be displayed if required.

    Syntax:

    HYPERLINK(URL[; Cell Text])

    Returns:

    Returns a text string, representing either the link target (when only one argument is supplied) or the alternative cell text (when a second argument is supplied).

    Arguments:

    URL is a text string (in quotation marks), or a reference to a cell containing a text string, that specifies the link target.

    Cell Text is a text string (in quotation marks) or a number, or a reference to a cell containing one of those types, that specifies alternative text to be displayed in the formula cell instead of the link target.

    Additional details:

    • The action necessary to open a hyperlink of this form depends on the current setting of the Tools ▸ Options ▸ LibreOffice ▸ Security ▸ Security Options and Warnings ▸ Options ▸ Ctrl-click required to open hyperlinks option (LibreOffice ▸ Preferences ▸ LibreOffice ▸ Security ▸ Security Options and Warnings ▸ Options ▸ Ctrl-click required to open hyperlinks on macOS). If the option is ticked, then use Ctrl+click with the cursor positioned over the hyperlink; if the option is not ticked, then use left-click with the cursor positioned over the hyperlink.
    • If you want to edit a hyperlinked cell but find that clicking it directly opens the hyperlink, select a nearby cell and navigate to the hyperlinked cell using the keyboard arrows.
    • If a cell contains a HYPERLINK function call (even if the HYPERLINK function is not evaluated), then that cell becomes a hyperlinked cell; that is, if you click on it it will attempt to open the target link. This means, for example, in a cell containing the formula
    =IF(TRUE(); "some text"; HYPERLINK("https://www.example.com"))
    the HYPERLINK function is never evaluated. Nevertheless the cell initially becomes a hyperlinked cell. However, when the formula cell is clicked, the link will fail.

    Examples:

    Formula Description
    =HYPERLINK("https://www.example.org") Here the function displays the text "https://www.example.org" in the formula cell and opens https://www.example.org when clicked.
    =HYPERLINK("https://www.example.org"; "Click here") Here the function displays the text "Click here" in the formula cell and opens https://www.example.org when clicked.
    =HYPERLINK("https://www.example.org"; 12345) Here the function displays the number 12345 in the formula cell and opens https://www.example.org when clicked.
    =HYPERLINK(B4) where cell B4 contains the string "https://www.example.org" (entered without quotation marks). Here the function displays the text "https://www.example.org" in the formula cell and opens https://www.example.org when clicked.
    =HYPERLINK("https://www."; "Click ") & "example.org" Here the function displays the text "Click example.org" in the formula cell and opens https://www.example.org when clicked.
    =HYPERLINK("#Sheet1.A1"; "Go to top") Here the function displays the text "Go to top" in the formula cell and jumps to cell Sheet1.A1 in the current document when clicked.
    =HYPERLINK("file:///C:/miscellaneous/writer.odt#Specification"; "Go to Writer bookmark") Here the function displays the text "Go to Writer bookmark" in the formula cell and, when clicked, opens the specified text document at the location of the "Specification" bookmark.
    =HYPERLINK("file:///C:/spreadsheets/"; "Open spreadsheets folder") Here the function displays the text "Open spreadsheets folder" in the formula cell and, when clicked, shows the contents of the C:/spreadsheets/ folder in a file manager window.

    Related LibreOffice functions:

    None.

    ODF standard:

    Section 6.11.3, part 2

    Related (or similar) Excel functions:

    HYPERLINK