Data & analytics

Google Sheets formula prompt

A copy-and-paste prompt for ChatGPT, Claude or Gemini that gets a professional google Sheets formula on the first try, plus the cheapest model that does it well.

What most people type

google sheets formula that counts how many rows in column B are dates in the last 30 days

The better prompt

Write a Google Sheets formula that counts how many rows in column B contain a date within the last 30 days (up to and including today). Ignore blank cells and text. Give the formula, then one or two lines explaining how it works and how to change the range if my data starts below row 1 (for example, a header row).

Why this version works

  • Defined 'last 30 days' window boundaries. Avoids ambiguity about today and future dates.
  • Excluded blanks and text. Prevents miscounts from non-date cells.
  • Asked for formula plus short explanation. Quick how-to needs the answer and a brief note.
  • Noted header row handling. Column ranges often include a header.

What a professional google Sheets formula prompt covers

  • Asks for the formula with a one-line explanation
  • Short

Best AI model for this prompt

This is a light task: simple single formula using COUNTIFS with TODAY; small model handles it reliably. You don't need the most expensive model. The cheapest model at each company that handles it well:

CompanyModelPer usePer 1,000 uses
AnthropicClaude Haiku 5.5cheapest$0.00008$0.08
OpenAIGPT-6 Luna$0.00008$0.08
GoogleGemini 3.1 Flash-Lite$0.00024$0.24

Pay-per-use list prices for this prompt and its expected answer (about 150 tokens). On a monthly chat plan, the same choice shows up as more messages before you hit your limit. See today's AI prices.

Google Sheets formula prompt for ChatGPT, Claude and Gemini (Data & analytics) · PromptSaver