---
title: "Creating Unique Ranges from 2D Arrays in Google Apps Script &#8211; Yagisanatode"
author: "Martin Hawksey"
date: 2020-11-04T22:13:52+00:00
modified: 2020-11-04T22:14:46+00:00
canonical_url: https://pulse.appsscript.info/p/2020/11/creating-unique-ranges-from-2d-arrays-in-google-apps-script-yagisanatode/
markdown_url: https://pulse.appsscript.info/p/2020/11/creating-unique-ranges-from-2d-arrays-in-google-apps-script-yagisanatode.md
categories:
  - "Advanced"
  - "Sheets"
  - "Solutions"
  - "V8"
tags:
  - "@LifeOfSpy"
  - "yagisanatode.com"
featured_image: https://pulse.appsscript.info/files/2020/11/creating-unique-ranges-from-2d-arrays-in-Google-Apps-Script-1.jpg
description: "Sometime you might have a use case where you need to replicate the UNIQUE functionality in Google Apps Script. Whatever the case, knowing how to to create a unique array from a 1-dimensional array or a 2-dimensional array is an important part of your toolkit as a coding goat 🐐. This tutorial will look at how to create this with modern Javascript that is incorporated into the Google Apps Script language."
---

# Creating Unique Ranges from 2D Arrays in Google Apps Script &#8211; Yagisanatode

![Creating Unique Ranges from 2D Arrays in Google Apps Script &#8211; Yagisanatode](https://pulse.appsscript.info/files/2020/11/creating-unique-ranges-from-2d-arrays-in-Google-Apps-Script-1.jpg)

> [https://yagisanatode.com/2020/10/26/creating-unique-ranges-from-2d-arrays-in-google-apps-script/](https://yagisanatode.com/2020/10/26/creating-unique-ranges-from-2d-arrays-in-google-apps-script/)
> If you have ever done any work in Google Sheets you might have come across the incredibly useful UNIQUE function. This function can take a single row or multiple rows and generate a list of unique cell values.
> Sometime you might have a use case where you need to replicate the UNIQUE functionality in Google Apps Script. … Whatever the case, knowing how to to create a unique array from a 1-dimensional array or a 2-dimensional array is an important part of your toolkit as a coding goat 🐐.
> This tutorial will look at how to create this with modern Javascript that is incorporated into the Google Apps Script language.

Source: *[Creating Unique Ranges from 2D Arrays in Google Apps Script – Yagisanatode*](https://yagisanatode.com/2020/10/26/creating-unique-ranges-from-2d-arrays-in-google-apps-script/)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2020/11/creating-unique-ranges-from-2d-arrays-in-google-apps-script-yagisanatode/](https://pulse.appsscript.info/p/2020/11/creating-unique-ranges-from-2d-arrays-in-google-apps-script-yagisanatode/)*
