UNPIVOT

UNPIVOT IN GOOGLE SHEETS

-ChatGPT -GoogleSheets
Author

Kevn Gilds, MPA

Published

2023-06-22

I watched this video on YouTube of a creator working with ChatGPT on writing formulas and Google App Script for Google Sheets.

Here is a link to my conversation with ChatGPT about converting wide data to a long format.

The fun part was that ChatGPT just made up a Google Sheets function; however this function should exist in Google Sheets.

"Open your Google Sheets document and navigate to a new sheet or a blank area where you want to create your long-format data set.
In the first cell of the new sheet, enter the following formula: =UNPIVOT(SourceSheet!A1:D, 'New Header Column, New Value Column)'"

    "Replace SourceSheet!A1:D with the range of your wide data set.
    Replace New Header Column with the desired header name for the column that will contain the original header values.
    Replace New Value Column with the desired header name for the column that will contain the corresponding values.

This seems like you would do this data manipulation in R and maybe Python.

When I called ChatGPT out on it here was the response:

Hello, is UNPIVOT a google sheet function?

Apologies for the confusion caused. I apologize for the incorrect information provided earlier. The UNPIVOT function is not a built-in function in Google Sheets. I apologize for the oversight in my previous response.


About

Kevin is a nonprofit data professional operating out of Lakeland, Florida.
My expertise is helping nonprofits collect, manage and analyze their program data.