Find first, last & nth value in a Google Sheets range with Apps Script

Published: 26 January 2023
on channel: Yagisanatode -Scott-
1,318
15

Get the Starter Sheet and Code here:
https://yagisanatode.com/find-first-l...

You can use the same 'Find' in Google Sheets as you can with Google Apps Script. This can be useful to search for data, rows and columns in larger coding projects.

In this tutorial we explore how to:
1. Two approaches to finding the first value or text in a Google Sheet with apps script.
2. Find the last matching value or text.
3. Find a 'n'th value. For example, you might want to find the 3rd value or text and do something with it.
4. Find the first set of items. Here you can customise how many items you want to find.
5. Make a very handy reusable function that will find the first set of values or the reverse, and find the last set of values.

00:00 What we'll build.
00:51 Find First using Find All
06:32 Find First with an iterator.
09:29 Find last
12:16 Find value at nth position
14:32 Find first n (e.g. 3) items
18:56 Make a reusable function to find 1st or last n items.

** Part of the Find and Replace with Apps Script Series **
   • Apps Script - Find & Replace in Googl...  

** My Site **
https://yagisanatode.com/

** More on Google Apps Script **
https://yagisanatode.com/google-apps-...

** Products **
Courses *
https://yagisanatode.com/products-cat...

Google Workspace Tools *
https://yagisanatode.com/products-cat...

Google Workspace Add-ons *
https://yagisanatode.com/products-cat...


Watch video Find first, last & nth value in a Google Sheets range with Apps Script online, duration hours minute second in high quality that is uploaded to the channel Yagisanatode -Scott- 26 January 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,318 times and liked it 15 visitors.