<div>00:00 Hello, oh, so, Terence, BetterSheets member Terence, had a question about cell
references
. When I have been doing AI integration inside of Sheets and
sort
of writing a GPT
function
or writing
sort
of just open AI
function
we have this
function
here, we have
function
, it's literally- called<br>00:20 AI, and then we have the prompt, some text here.
GPT in SHEETS
OpenAI API Prompt and Response
AI Formula in Google Sheets
And he was asking, you know, he's been following three or four or five different videos
where
I talk about AI, and he probably hasn't seen yet this video
where
I create
sort
of a, a chat- it
sort
of looks like a chat interface, but what it really<br>00:39 is is to look at all- of your prompts in a row and see which ones are good or bad. And this one might actually surprise him because it doesn't have a
function
inside of B2 here.<br>00:51
Where
we write this prompt, we, we execute a
function
that's completely separate.
Run 100 ChatGPTs at One Time
CLUTTERED CODE
So this user fun- this user experience might be very interesting.<br>01:01 But he was looking at, Terrence was looking at past videos
where
I wrote a custom
function
called openAI and then had some prompt in here, but had a variety of different cell
references
across many different videos.<br>01:18
Sort
of each video I made a different way. One time I did Q and then I wrote ampersand A1 and then ampersand and then had space A and then had this.<br>01:39 This
sort
of fun, this
sort
of.
Syntax
here.
GPT in SHEETS
CLUTTERED CODE
Let me
sort
of try to make this a little bit bigger.<br>01:46 And with this
syntax
, I think the reason I did this is because that is literally how the AI prompt was written.<br>01:53 I was actually using an example from open AI's own documentation and they said, you know, make the prompt in this way.<br>02:00 Put Q.
Building an AI Prompts Playground
Writer Better Prompts
OpenAI API Prompt and Response
CLUTTERED CODE
Put your question and then put literally the text a colon and that's the end of your prompt and then it will complete because what this AI is doing and what this LLM is doing is text completion.<br>02:15 It is taking this question and answer going from a colon and then just completing. That it is not necessarily answering the question.<br>02:25 It is saying what in this vast database of knowledge would be the next token after a after this answer or what would be this answer.<br>02:38 And so that was what I originally did and then.
Run Every Prompt in Every Cell All At Once
I've been
sort
of doing different cell
references
like for instance, right now for this particular
app script
, which is just AI prompt.<br>02:54 I know in my head and how I wrote this
app script
, I know that all I need is the prompt.<br>03:00 I don't need to add any more. I need to add any more extra curricular information with the GPT
function
that I wrote.<br>03:07 I put all of the tokens, the temperature, the top P, the frequency penalty, the presence penalty. I put that all in here.<br>03:14 So I needed to
reference
all of those
cells
to get all that information into the
function
name.
GPT in SHEETS
OpenAI API Prompt and Response
AI Emails Me Every Day
But for this particular
app script
, I needed to add any more
function
, AI, that I wrote.<br>03:26 I literally just need the prompt. I don't need to put in all of this. I could write this
app script
where
all of this message is some kind of variable here.<br>03:42 And then I write message here, and in this case, I would need to recreate all of what I just deleted.<br>03:49 I would need to write in all of here, in here probably in quotes. Whoops. That's the APA. There it is.<br>04:04 I would need to put into the cell, into the cell here.
Writer Better Prompts
OpenAI API Prompt and Response
AI Emails Me Every Day
But right now, because I wrote this
function
as just ai prompt, and then put this prompt variable in here on line seven, I only need to put in some question, or write, I can put in.<br>04:22 Here, write, write a summary of the ten commandments in three words. I don't think this is gonna work, but we'll see.<br>04:36 There we go, done. Right? I just have some text, put in quotes, and that's it.
Writer Better Prompts
CLUTTERED CODE
But now I'm like, I have to, I need to write this equal sign, ai, I need to write anything I want to write, I have to go into these quotes, between these double quotes, and I have to write it.<br>04:52 What I really want to do is use all of the power of Google Sheets. I want to utilize anything and everything.<br>05:00 I want to utilize multiple variations of, this. So I want to start doing cell
references
. I want to say, okay, I'm going to
reference
, actually, I'm going to put in a1 the prompt.<br>05:13 What it summarize the 10 command, let's do that, in five words.
Run Every Prompt in Every Cell All At Once
Bigger Brain
AI Formula in Google Sheets
That's the prompt I want to do. So I'm going to do equals, in b2, I'm going to go over here, ai, and I'm just going to do
cell reference
a2.<br>05:30 That is all I have to do. I don't have to put in any extracurricular information. I want to make this as simple as possible, and I have done that by way of the
function
.<br>05:41 But sometimes, maybe there's other things, so we'll, talk about that in a second. But let's just get this done, right?<br>05:45 We have a
cell reference
to a2. And here's the answer, right? There's five words.
Run Every Prompt in Every Cell All At Once
AI Formula in Google Sheets
What if, for instance, this is a good example, a2, just putting a2 in.<br>05:57 If I'm like, I'm going to write the whole thing here, and if I copy and paste this down, I'm going to have a blink.<br>06:02 This is going to be a3. I have nothing here. But I want to maybe copy and paste this and put in ten words.<br>06:09 Maybe I want to do in twenty words, and I'm going to, Or maybe I want to even do in three bullet points.<br>06:23 See if that does, That's it, right? So I can also, Yeah, let's do that. Let's make this a little easier to read.<br>06:33 See everything. Right?
Run Every Prompt in Every Cell All At Once
CLUTTERED CODE
So now I'm referencing this A2 here. I'm referencing A3, but what if, What if I was like building some kind of, interface, and I was like, this is gonna be some other user, or me in the future, and I'm like, I know in this particular sheet, with this particular
Apps Script
, I'm<br>06:56 gonna write summarize the 10 commandments, and I'm always gonna have some variable here.
Are you an A1 or B2 Kind of Sheet Guy?
VIBE CODE GOOGLE SHEETS
Okay, so in this case, I can cut that, summarize the commandments, the thing that's the same thing, all the way through, I can just put that, right here, in the B2, right, in the
function
, put the ampersand <br>07:18 I know I'm gonna use the word in, and now all I have to do, I can copy all of this down, is write 10 words, actually I need a space, right after the in I don't need the period, I don't need that, I need 20 words, 3 bullet points, in, maybe I wanna do in 10 emojis, something like that, right<br>07:49 , so now I know I am building this sheet, that is the 10 commandments summary sheet, I know the prompt is summarize the 10 commandments summary, and that x is a2 or a3, but like.<br>08:05 You know, this is a different use of this prompt, okay, I am getting maximum execution time, oh, it is probably because I just did it all at the same time, this is actually wrong, three bullet points ends up being 10 bullet points right, so now we have this.<br>08:25 We are using this in a different way, right, we are using Google Sheets to do the prompt, we have some text in the
function
here, we have some text and
syntax
in the
app script
, right, we have this role system, we can also write our role.<br>08:45 Here we can say something like, you are an expert in the ten commandments, you can, you write like Charles Bukowski, I don't know no, probably, maybe Shakespeare, you write like Shakespeare, and I am, bic- pentameter.<br>09:09 You tell it like it is.
Run Every Prompt in Every Cell All At Once
Harada Method Template
I don't know, this is all crazy talk, but in this role, maybe this role, we want to, this is the system role we want to edit that on the fly, we want a different system role all the time, so we'll add that.<br>09:25 To our
function
, so in this case we're going to see, is there any actually difference? Okay, so there actually is a
sort
of a little, those emojis are hilarious, right?<br>09:40 Maybe we want to do a different system role, right? So instead of putting. This here, I'll just
comment
it out.<br>09:47 We're going to do prompt comma role.
GPT in SHEETS
And now in our
function
, we need another column here that says system. You are Salvador.<br>10:05 Salvador Dali. You are a member of the Starfleet Academy in Star Wars. Right? And in our here we need actually two things.<br>10:28 We need B2, comma, and then the actual plot. We're the Bible, right? Put that there. Copy all these down. And now, right, we have different information all over.<br>10:54 We have messages, we have role prompt, we have that prompt and role here in our
function
.
We write it in here in our
function
here.<br>11:01 We have a little bit of text here, and then we put our system
function
here. Prompt here. Actually, it's not our prompt, it's our
sort
of input.<br>11:12 Okay, we are getting some weird
answers
here. I am not solving our dolly. I have a language model. Oh, that's creepy.<br>11:22 Great. So, you know, we can have all this. We can have all this information in many different places, and it's our choice to put it in different places based on what is the user want.<br>11:33 Are we building this for ourselves?
Writer Better Prompts
CLUTTERED CODE
Do we just want a very simple prompt writer? We might. We might do that by just not having the role here in our
function
name.<br>11:46 And we might just put the variable role here as nothing, and we're just going to get the prompt. And we don't need all of this column we just need here.<br>12:03 And maybe we do want to write the entire, we want to. See the entire prompt. If we're writing this, if we're creating this app inside of a Google Sheet for other people.<br>12:15 Say it's our own organization.
Writer Better Prompts
VIBE CODE GOOGLE SHEETS
We don't necessarily need to write the prompt in
Apps Script
to
sort
of
hide
it.<br>12:25 We might want to write it here because we want. Some flexibility. We want to edit it at some points, but we don't necessarily need the user to see exactly that prompt.<br>12:34 They can definitely have access to it. And putting it in text in
sort
of A2 all together. That means every single time we sit here and write, we have to write it out.<br>12:46 We have to. Write out all of that stuff, but maybe we have half the prompt.
Writer Better Prompts
CLUTTERED CODE
Or we have some examples and we're like, you know, we just want those examples somewhere.<br>12:55 We can even put them on a completely different sheet. We can say examples, right? And point to this example in A1 and
combine
it here.<br>13:06 In our prompt. We can say and examples include. Ampersand. Examples. A1. Right, and if there were some examples there. It would include that in the prompt in the
function
.<br>13:25 We have a
reference
to it. Right, so if somebody were coming in here and say I want to edit these examples.<br>13:31
Where
would I edit it? They would look at this. B2.
Create a ChatGPT Cheat Sheet Spreadsheet
How To Reference Another Sheet in Conditional Formatting
They say oh, here's examples. A1. They can follow the chain.<br>13:38 Okay, so it's a little bit harder to edit. In theory. But it actually ends up being easier to edit because literally I'm like I just want to edit the examples.<br>13:47 Okay, go here, do examples, and write input. Three words. Put response. Do not murder. Kill. Right. I don't know if that was, that's an actual one, but.<br>14:06 There we go. So that's interesting.
Create a ChatGPT Cheat Sheet Spreadsheet
CLUTTERED CODE
So we can use all of the power of Google Sheets in a
number
of different ways for a
number
of different reasons, right?<br>14:14 I would say,
sort
of all of these things, balance,
protection
versus editability versus flexibility.. And you can be as flexible, as editable as you want.<br>14:28 Or, not at all. You could take all of this and everything not the API, in
cell reference
. You could not have a prompt here.<br>14:37 And you could say, and right here, variable prompt equals, And you could go ahead and write your entire prompt.
When did you learn the secrets of Google Sheets? | Sheet Talking Episode 8 Esa
Bigger Brain
Why Spreadsheets are Spreadsheets
Everything you want to put in.<br>14:48 Examples you want to put in styles, you want to put in tone. All of that right here. You can put all of your role in here.<br>14:53 The entire system you can put it all in
Apps Script
. And then the user, all they can do is write AI and they'll get, they'll get something.<br>15:04 Maybe your temperature is one. Maybe you're like, okay, every time that you put in AI. I put in this prompt.<br>15:10 We want a different result. We want, you know, different things.
Writer Better Prompts
OpenAI API Prompt and Response
Bigger Brain
AI Emails Me Every Day
Maybe we increase the max tokens, but we don't want this necessarily editable.<br>15:19 It is editable. I can edit it. I'm editing it right now. But someone who was familiar with Google Sheets. Might not know exactly, they might know that
Apps Script
exists, but they might not know that your AI is editable in
Apps Script
and
where
to do that.<br>15:40 They can't tinker around with it. Tamper with it. If you want to make it easily findable in.
How To Use a 1-Cell Google Sheet
Automation is not Magic
Typeable, because maybe you have this
function
, it's not AI, maybe it is write the 10 commandments in a funny way.<br>16:02 This is a horrible way to do it, but maybe that is the
function
. What I think it is. Is, I'm gonna do this on the fly, I'm gonna do a
comment
, at custom
function
.<br>16:14 And now, if I start typing in here, write, there it is, write the 10 commandments in a funny ways. And maybe you have two
functions
, right?<br>16:26 Maybe you have another
function
called. Write it in a silly way, write it in a serious way.
CLUTTERED CODE
And you create these
functions
that someone, all they have to do is write this, write the 10 commandments in a funny way.<br>16:37 And bam, they get a response.
They don't know it's AI, they don't care, they don't care all of your prompt, they don't care everything, but they do have access to it, right?<br>16:44 Anyone
who has access
to it is trading off a lot of
protection
, but not 100%
protection
, for editability, for the person to write it, for flexibility as well.<br>16:57 And if you watch, the complete opposite of this particular
function
that I have written right here is the GPT
function
in another video which I write the GPT
function
.<br>17:05 And literally write all of the possibilities of roll the- the prompt, the model, the temperature, all of that is in the
function
variables.<br>17:14 And you have to put those in if you want to use this
function
inside of Google Shades.
GPT in SHEETS
AI Formula in Google Sheets
In a funny way.<br>17:29 Here are three examples. And we're gonna write the three examples. And maybe we write in the tone of George Carlin.<br>17:39 I mean, that's particularly funny. But write in, in the style of some. Other Richard Pryor, right?. Write three sentences. Make them full sentences, right?<br>18:01 No, not bullet points, not anything else, not emojis, right?. We can write that entire prompt here and we don't have to put any in.<br>18:09 Puts in there. And almost the complete opposite is the GPT
function
that I wrote.
Writer Better Prompts
That includes all of the
functions
parts of the
functions
, all in the particular order.<br>18:20 But also, you can put prompt here, right? You can say, oh, I don't want it in here. I want to be able to edit it.<br>18:29 So I'm gonna, write here prompt, and I'm not gonna write the 10 commandments. I'm gonna write write. Maybe I just want to say write.<br>18:37 Now, You go equal, right? Oh, you need to, get saved. Yeah. Equals, right? And that's all we have. It's right.<br>18:49 Our prompt. Prompt goes here. Right? So, we can put this information in many different ways.
Ultimate Prompt Writer and Prompt Rater
Writer Better Prompts
We can use app
app script
.<br>19:00 We can use Google Sheets. Also check out if you haven't yet. Spin text, content spinner. This might help you a lot.<br>19:09 So instead of doing, Like this kind of thing, you would do equals spin all. Some text that is like 10, 20, 30 words.<br>19:33 And so just by doing that, just typing in this spin
syntax
, this curly brackets, 10, 20, 30 words it automatically creates those there for you.<br>19:44 So you can spin some interesting content here. I'll save that. You should watch that video as well.
NEW TOOL Parse Spintax for Content Spinning
How to Spin Content
Spintax Content Spinner for Google Sheets
Quickly Add Text In Front of Text with Apps Script
About the spin tax.<br>19:52 And it's a free Google sheet
add-on
you can add to your Google sheet. Anyway, alright thanks for watching and I hope this
answers
your question to some extent of why do we put that why do we use self
references
?<br>20:03
Where
do we put that self
reference
? We are trading flexibility or trading editability and
protection
against. Somebody else editing, tampering it or ourselves.<br>20:14 Oh, we might want to edit edit.
How to Spin Content
Spintax Content Spinner for Google Sheets
Why Spreadsheets are Spreadsheets
We might want to prevent our future selves from editing something or just making it a step or two harder.<br>20:24 It is not, you know, completely fixing protecting this text from someone. So. Hopefully that
answers
your question. Bye.</div>