|
Gemini
| #158

Gemini: Automatically highlight duplicates in Sheets

(you can easily filter previous issues by application!)


Previously on: Removing Duplicates

A few months ago, Google Sheets rolled out an amazing feature: Remove Duplicates.

You could select the entire tab (CMD/CTRL + A), click “Remove Duplicates” and all rows with duplicated instances would be removed.

But those of us who have spent any time working with spreadsheets know it’s not a perfect solution, since there are times where you want to manually confirm duplicated instances without removing them immediately.

  • For example: If an assistant signed up for an event twice using the same email but for two separate client executives, we do not want to remove any of those instances!

Gemini to the rescue

Following the example above (I had to do this many times before Gemini was a thing because I ran lots of events as a PMM at Google), you want to end up with something like this:

Type this prompt within Gemini (replace the text in [brackets] with your own specific use case):

Apps Script Prompt

Assume the role of a Google Apps script expert with over 20 years of experience.

I need to automate some functions in a Google Sheet.

Your task is to assist me with the app script to accomplish the following:

[I have a tab named "attendee" that automatically populates with contact information. There is a header row and one of the columns named "email" contain emails]

I want to click a custom menu button to [highlight all duplicate instances of emails]

If you run into errors, simply copy and paste the error into this troubleshooting prompt:

Prompt for Troubleshooting

I ran into the following error after executing the script: [error message]

Your task is to fix this error, and share a fully revised script with the necessary corrections.

Do not include presets and placeholders.

Take your time and get this right.

Think through this step by step.

Running into errors is totally normal; sometimes Gemini would get it right on the first try but sometimes not. I've refined this troubleshooting prompt so that as long as you continue pasting in the error code, Gemini will eventually get it right!


Want to see more (or less) of this? Tap the thumbs up or down to let me know ⬇️

Want someone to be more productive? Let them subscribe here 😉

Thanks for being a subscriber, and have a great day!