Formula Examples for Excel and Google Sheets

Sometimes the fastest way to solve a spreadsheet problem is to start from a pattern you already trust. This hub collects useful examples across lookups, IF logic, conditional totals, counts, text cleanup, dates, and common repairs, then points you to the right generator, explainer, or fixer when the formula needs more context.

Start with a reference pattern, then move to the right tool when the formula needs context

Formula examples are most useful when you already know the pattern you want to adapt. They save time because you can start from something recognisable instead of describing the whole task from scratch.

Once the formula needs your exact columns, sheet names, thresholds, or debugging context, the dedicated tool pages become the better next step. This page is a reference hub, not a substitute for custom generation or repair.

Move from reference pattern to page-specific help

Lookup examples

Use these when you need to match an ID, product code, or reference value and return related data from another column or sheet.

Find customer name by ID

Prompt: Find customer name by ID

Example formula

=VLOOKUP(A2,$F:$H,2,FALSE)

Looks up the customer ID in the first column of F:H and returns the customer name from the second column.

Return price by product code

Prompt: Return price by product code

Example formula

=XLOOKUP(A2,Products!A:A,Products!D:D,"Not found")

Searches the product code and returns the matching price from another column.

Return department by employee ID

Prompt: Return department by employee ID

Example formula

=XLOOKUP(G2,Employees!A:A,Employees!C:C,"No match")

Matches the employee ID and returns the department without needing a column index number.

Need a version tailored to your own sheet instead of a fixed pattern from this section?

Go to XLOOKUP Formula Generator

IF examples

Use these when the sheet needs a label, status, or decision based on a condition, threshold, or blank-cell check.

Pass or fail

Prompt: Pass or fail

Example formula

=IF(B2>=70,"Pass","Fail")

Checks whether a score reaches the threshold and returns one of two labels.

Overdue or on time

Prompt: Overdue or on time

Example formula

=IF(E2<TODAY(),"Overdue","On time")

Compares a due date to today and returns a status label.

Tiered category

Prompt: Tiered category

Example formula

=IF(D2>=10000,"High",IF(D2>=5000,"Medium","Low"))

Uses nested IF logic to classify values into three levels.

Need a version tailored to your own sheet instead of a fixed pattern from this section?

Go to IF Formula Generator

SUMIF and SUMIFS examples

Use these when the question is how much to total by category, period, region, or another reporting condition.

Sum by region

Prompt: Sum by region

Example formula

=SUMIF(B:B,"East",C:C)

Adds values in column C only when column B contains East.

Sum by category

Prompt: Sum by category

Example formula

=SUMIF(B:B,"Software",C:C)

Totals revenue for rows marked Software in the category column.

Sum by month and team

Prompt: Sum by month and team

Example formula

=SUMIFS(D:D,B:B,"March",C:C,"North")

Adds values only when two conditions are true at the same time.

Need a version tailored to your own sheet instead of a fixed pattern from this section?

Go to SUMIF and SUMIFS Formula Generator

COUNTIF and COUNTIFS examples

These patterns are common in dashboards, task trackers, and status summaries where the question is how many rows match the rule.

Count East region rows

Prompt: Count East region rows

Example formula

=COUNTIF(B:B,"East")

Counts rows where the region column matches East.

Count open tickets

Prompt: Count open tickets

Example formula

=COUNTIF(C:C,"Open")

Counts rows where the ticket status is Open.

Count active admins

Prompt: Count active admins

Example formula

=COUNTIFS(B:B,"Admin",C:C,"Active")

Counts rows that satisfy both the role and status conditions.

Need a version tailored to your own sheet instead of a fixed pattern from this section?

Go to COUNTIF and COUNTIFS Formula Generator

Date examples

Date logic tends to show up in operational sheets, invoice trackers, due-date views, and month-based summaries.

Show overdue

Prompt: Show overdue

Example formula

=IF(E2<TODAY(),"Overdue","Current")

Flags rows where the date in E2 is earlier than today.

Days remaining

Prompt: Days remaining

Example formula

=MAX(E2-TODAY(),0)

Calculates how many days remain until a future date without going below zero.

Current month count

Prompt: Current month count

Example formula

=COUNTIFS(A:A,">="&EOMONTH(TODAY(),-1)+1,A:A,"<="&EOMONTH(TODAY(),0))

Counts rows whose date falls inside the current month.

Need a version tailored to your own sheet instead of a fixed pattern from this section?

Go to Excel Formula Generator

Text examples

Text functions are useful for imports, name cleanup, labels, and preparing spreadsheet data for reporting.

Extract first name

Prompt: Extract first name

Example formula

=LEFT(A2,SEARCH(" ",A2&" ")-1)

Returns the text before the first space so you can isolate a first name.

Join first and last name

Prompt: Join first and last name

Example formula

=A2&" "&B2

Combines values from two cells into one full-name label.

Remove extra spaces

Prompt: Remove extra spaces

Example formula

=TRIM(A2)

Cleans leading, trailing, and repeated spaces in imported text.

Need a version tailored to your own sheet instead of a fixed pattern from this section?

Go to Google Sheets Formula Generator

Error examples

These examples show the kinds of broken formulas that usually need a quick debugging pass rather than another tutorial tab.

Missing VLOOKUP match mode

Prompt: Missing VLOOKUP match mode

Example formula

=VLOOKUP(A2,A:D,4,FALSE)

A common correction is adding FALSE so the lookup uses exact match behavior.

Missing parenthesis

Prompt: Missing parenthesis

Example formula

=IF(B2>100,"High","Low")

Closing the missing parenthesis is enough to restore the formula structure.

Separator mismatch

Prompt: Separator mismatch

Example formula

=SUMIF(B:B,"East",C:C)

Normalizing separators is a fast way to fix formulas copied between different setups.

Need a version tailored to your own sheet instead of a fixed pattern from this section?

Go to Fix Excel Formula Errors

Frequently asked questions

Are these examples for Excel or Google Sheets?

Many work in both, but some syntax can vary. Use the linked generator pages when you want platform-specific output.

When should I use this page instead of the formula generator?

Use this page when you want a proven pattern to adapt quickly. Use the generators when the formula needs to match your exact columns, criteria, sheet names, or platform-specific setup.

Can I copy these examples directly?

Yes, but you may need to adapt ranges, sheet names, or criteria so the formula matches your own file.

What if I need a formula that is similar but not identical?

Use the related generator page and describe your exact case in plain language to get a formula closer to your sheet.

Is this page good for learning formulas?

Yes. It is designed as a practical reference page with examples you can inspect and adapt quickly.

Which page should I use if the formula already exists but I do not understand it?

Go to Excel Formula Explainer when the formula is present and you want a plain-English breakdown before you edit it.

Which page should I use if my formula is broken?

Go to Fix Excel Formula Errors if you already have a formula that is not working.

Need something closer to your own sheet?

The examples hub works best as a reference layer. These pages take you into custom generation, explanation, and repair when the pattern alone is not enough.