logo
Microsoft Excel - Interview Questions and Answers
How do you create a hyperlink in Excel?

In Microsoft Excel, you can create a hyperlink to link a cell to a webpage, file, email address, or even another spot in your workbook. Here’s how to do it, with a few methods depending on your goal:

Method 1: Using the Insert Hyperlink Feature :
    1. Select the Cell :
      • Click the cell where you want the hyperlink (e.g., A1).

    1. Open the Hyperlink Dialog:
      • Go to the Insert tab on the Ribbon.
      • Click Link (or Hyperlink in older versions).
      • Or, right-click the cell and choose Link (or Insert Hyperlink).

  1. Set the Link Type:
      • In the dialog box, pick your destination:
          • Existing File or Web Page: Enter a URL (e.g., "https://www.example.com") or browse to a file.
          • Place in This Document: Link to a specific cell (e.g., "Sheet2!B5") or defined name.
          • Create New Document: Link to a new file you’ll create.
          • E-mail Address: Type an email (e.g., "mailto:someone@example.com").
      • Text to Display: Customize what shows in the cell (e.g., "Click Here" instead of the full URL).
  2. Confirm:
    • Click OK. The cell now shows clickable text—click it (or Ctrl+click, depending on settings) to follow the link.

Method 2: Using the HYPERLINK Function
  1. Enter the Function:
      • Click a cell and type: =HYPERLINK("link_address", "friendly_name")
        • link_address: The URL or destination (e.g., "https://www.example.com" or "Sheet2!B5").
        • friendly_name: (Optional) Text to display (e.g., "Visit Site"). If omitted, the address shows.
      • Example: =HYPERLINK("https://www.google.com", "Google")
  2. Press Enter:
    • The cell displays "Google" as a clickable link to the URL.

Method 3: Drag and Drop or Typing :
  • Web URL: Just type "https://www.example.com" into a cell and press Enter—Excel auto-detects and converts it to a hyperlink.
  • File Path: Type a full path (e.g., "C:\Users\Name\Documents\file.xlsx") or drag a file from File Explorer into a cell (Windows only). It’ll link to that file.

Editing or Removing :
  • Edit: Right-click the cell, select Edit Hyperlink, and tweak it.
  • Remove: Right-click, choose Remove Hyperlink, or clear the cell (Delete key).
Tips :
  • Use Ctrl+click to follow links in newer Excel versions (it’s a safety feature).
  • For workbook navigation, linking to "Sheet2!A1" jumps you there instantly.
  • Test links after creating—especially file paths, which can break if moved.
Example :

To link cell B2 to xAI’s site :

  • Insert > Link > Type "https://www.xai.ai" > Set display text to "xAI" > OK.
  • Or: =HYPERLINK("https://www.xai.ai", "xAI").
  • Click B2, and you’re at xAI’s page.