Practical Guide to Digital Skills & Software

Home » Complete Guide to Using the VLOOKUP and HLOOKUP Formulas in Google Sheets for Beginners

Complete Guide to Using the VLOOKUP and HLOOKUP Formulas in Google Sheets for Beginners

For those of you who are involved in the world of administration, finance, and data management e-commerce, Whether it’s blog or business reporting, processing large amounts of data is a daily routine. Checking hundreds of data points manually is certainly tiring, time-consuming, and prone to human error (human error).

Fortunately, Google Sheets provides two powerful functions created specifically to match and extract data automatically: VLOOKUP and HLOOKUP.

If you still feel unfamiliar or confused about how to use these two formulas, don't worry! This article will thoroughly explain the complete guide, differences, and practical examples of using VLOOKUP and HLOOKUP in Google Sheets specifically for beginners.

ilustrasi Google Sheets khusus untuk pemula.

Understanding the Basic Differences: VLOOKUP vs HLOOKUP

Before getting into the technical formulas, let’s first understand the meaning of these two abbreviations so that you don’t make the wrong choice when applying them:

  • VLOOKUP (Vertical Lookup): Used to retrieve data from a table that is organized in a vertical (descending). The first column of the lookup table is where the data reference resides.
  • HLOOKUP (Horizontal Lookup): Used to retrieve data from a table that is organized in a horizontal (vertically to the side). The first row of the lookup table is where the data reference resides.

Part 1: Mastering the VLOOKUP Formula (Vertical Search)

VLOOKUP is the most commonly used formula in everyday work. Imagine you have a list of products in a table, and you want to automatically find the price of the items by simply entering the product code.

Basic Syntax of VLOOKUP:

Plain text

=VLOOKUP(search_key, range, index, [is_sorted])


  • search_keyThe value or keyword you want to search for (for example: Item Code “BRG-01”).
  • rangeThe range of cells or tables where the lookup data resides (for example: A2:C10).
  • indexColumn number in the range (range) that you want to take the result of (calculated starting from 1 in the leftmost column of the range).
  • is_sortedType FALSE (or 0) for searching exactly the same (exact match), or TRUE (or 1) for near-search. For beginners, Always use FALSE to ensure accurate results.

Example of VLOOKUP Case:

Suppose you have a table of product data in a range A2:C6:

  • Column A: Item Code
  • Column B: Item Name
  • Column C: Price

If you want to search for the price of an item with a code “A02” those who are in the cell E2, Its formula is:

Plain text

=VLOOKUP(E2, A2:C6, 3, FALSE)

Explanation: The formula will look for the cell that contains “A02” in the first column of the table (A2:A6), then take the data in the third column (C) on the same row, which is the price of the item.

Part 2: Mastering the HLOOKUP Formula (Horizontal Search)

What if your report table is created horizontally to the side? This is where the role comes in. HLOOKUP. Although it is rarely used compared to VLOOKUP, this formula is essential for certain financial report or matrix formats that organize their data horizontally.

Basic Syntax of HLOOKUP:

Plain text

=HLOOKUP(search_key, range, index, [is_sorted])

Its structure is almost exactly like VLOOKUP; the difference lies in the parameters. index which refers to line number (not the column number).

  • search_key: The value to be searched for in the first row of the table.
  • rangeHorizontal range of reference tables.
  • indexThe row number from top to bottom within the range that the value is to be taken from.
  • is_sortedType FALSE (or 0) for exact match.

Example of HLOOKUP Case:

If the first row of your table contains a list of months (January, February, March) and the second row contains sales targets, to find the sales data for the month of “February” in the second row, the formula is:

Plain text

=HLOOKUP(“February”, A1:D5, 2, FALSE)

Part 3: Common Mistakes and Important Tips for Beginners

To ensure that your VLOOKUP and HLOOKUP formulas do not return an error message such as #N/A or #REF!, please observe the following important tips:

  1. Use the Dollar Sign ($) to Lock Range (Absolute Reference) If you want to pull the formula down (drag down) without causing the reference table range to shift, the range is reset using a $. Example: from A2:C6 to A2:C6 A2:C6.
  2. Make sure the Reference Column is on the leftmost side (Especially VLOOKUP) VLOOKUP I can only find it on the right side. The column containing the search_key must be in the leftmost column of the range The choice is yours. If your reference data is on the right side, you can use the combination of the INDEX and MATCH formulas as a further alternative.
  3. Beware of additional spaces The error message #N/A often occurs not because the formula is wrong, but because there are hidden spaces in your text data (for example, “A02” vs “A02”).

Conclusion

1. VLOOKUP Formula (Vertical Search)

Basic Syntax

Excel

=VLOOKUP(search_key, range, index, [is_sorted])
  • search_key: The value or keyword that you want to search for (must be in leftmost column dari range).
  • range: Rentang tabel referensi data, misalnya A2:D20.
  • index: Nomor urutan kolom (dihitung dari kolom paling kiri range, dimulai dari 1) yang nilainya ingin diambil.
  • is_sorted(opsional, tapi sangat disarankan diisi FALSE):
    • FALSE (atau 0): Mencari kecocokan persis (exact match). Gunakan ini untuk kode barang, ID, atau nama yang harus sama persis.
    • TRUE (atau 1): Mencari perkiraan terdekat (approximate match), mengharuskan kolom pertama diurutkan dari kecil ke besar.

Contoh Penggunaan VLOOKUP

Misalkan tabel referensi berada di A2:C5:

  • Kolom A: Kode Produk (PRD-01, PRD-02, PRD-03)
  • Kolom B: Nama Produk (Buku Catatan, Pulpen Gel, Penghapus)
  • Kolom C: Harga (15000, 5000, 3000)

Untuk mencari harga dari kode produk yang tertulis di sel E2:

Excel

=VLOOKUP(E2, $A$2:$C$5, 3, FALSE)

Angka 3 berarti mengambil nilai dari kolom ke-3 pada rentang A2:C5 (yaitu kolom C / Harga), dan FALSE memastikan pencarian tepat sama.

2. Rumus HLOOKUP (Pencarian Horizontal)

Basic Syntax

Excel

=HLOOKUP(search_key, range, index, [is_sorted])
  • search_key: Nilai yang ingin dicari (harus berada di baris paling atas dari range).
  • range: Rentang tabel referensi data, misalnya A1:E4.
  • index: Nomor urutan baris (dihitung dari baris paling atas range, dimulai dari 1) yang nilainya ingin diambil.
  • is_sorted (opsional, isi FALSE untuk hasil tepat): Sama seperti pada VLOOKUP, gunakan FALSE untuk pencocokan persis.

Contoh Penggunaan HLOOKUP

Misalkan tabel referensi tersusun menyamping di A1:D3:

  • Baris 1: Bulan (Jan, Feb, Mar, Apr)
  • Baris 2: Target Penjualan (10000000, 12500000, 11000000, 15000000)
  • Baris 3: Realisasi (9500000, 13000000, 10800000, 16200000)

Untuk mengambil nilai Realisasi (baris ke-3) berdasarkan nama bulan di sel B6:

Excel

=HLOOKUP(B6, $A$1:$D$3, 3, FALSE)

Perbandingan Cepat: VLOOKUP vs HLOOKUP

AspekVLOOKUPHLOOKUP
Arah TabelVertikal (data turun ke bawah)Horizontal (data menyamping ke kanan)
Posisi Kunci CariKolom paling kiri pada rangeBaris paling atas pada range
Parameter indexNomor kolom (1, 2, 3, ...)Nomor baris (1, 2, 3, ...)
Kasus UmumDaftar produk, karyawan, siswa, hargaRekap bulanan, jadwal, matriks per periode

Tips Penting Agar Tidak Error

  1. Gunakan tanda dolar ($) pada range, misalnya $A$2:$C$5, agar rentang tabel tidak bergeser saat rumus ditarik ke bawah atau ke samping.
  2. Bungkus dengan IFERROR agar jika kode tidak ditemukan tidak muncul #N/A:Excel=IFERROR(VLOOKUP(E2, $A$2:$C$5, 3, FALSE), "Data tidak ditemukan")
  3. Waspadai spasi tersembunyi dan format teks vs angka. Kode 101 (angka) berbeda dengan "101" (teks); gunakan TRIM() bila sering ada spasi berlebih di data sumber.

Menguasai rumus VLOOKUP dan HLOOKUP di Google Sheets adalah langkah awal yang sangat krusial untuk meningkatkan produktivitas kerja Anda. Dengan mengandalkan kedua fungsi ini, pekerjaan rekapitulasi data yang tadinya memakan waktu berjam-jam kini bisa diselesaikan hanya dalam hitungan detik.

Mulailah berlatih dengan membuat tabel kecil di Google Sheets Anda hari ini, dan rasakan sendiri kemudahan otomatisasi data!

admin

Welcome to Guía, your trusted center for digital skills education and software tutorials. We are here to make your learning journey easier with practical guides on productivity tools, AI technology, and the latest digital tips designed to be easy to understand by everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *