# AND formula generator

> Describe what you need and get a AND formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested AND examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/and · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

AND returns TRUE only when every condition you give it is TRUE.

Describe the task at [AND formula generator](https://spreadsheetpractice.com/tools/formula-generator/and) and get a AND formula for Excel and Google Sheets, tested on real data.

## Tested AND examples

### Check if a date is past due

`=IF(AND(C2="",B2<$G$1),"Overdue","")`

Excel. Result on the sample sheet: 6 rows (D2:D7). [See it and try it](https://spreadsheetpractice.com/formulas/if-date-is-past-due)

### Check if a date is between two dates

`=IF(AND(B2>=$F$1,B2<=$F$2),"Yes","No")`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-a-date-is-between-two-dates)

### Use IF with multiple conditions

`=IF(AND(B2>=$G$1,C2>=$G$2),"Bonus","No bonus")`

Excel. Result on the sample sheet: 6 rows (D2:D7). [See it and try it](https://spreadsheetpractice.com/formulas/if-with-multiple-conditions)

### Flag dates that are due in the next 30 days

`=IF(AND(B2>=$F$1,B2<=$F$1+$F$2),"Renews soon","")`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/flag-dates-due-in-next-30-days)

### Check if a cell contains a date

`=ISNUMBER(A2)`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-a-cell-contains-a-date)

### Check if a value is within a percentage of a target

`=IF(ABS(C2-B2)/B2<=$G$1,"OK","Check")`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-within-a-percentage-tolerance)

### Check if a time is between two times

`=IF(MOD(B2-$F$1,1)<MOD($F$2-$F$1,1),"Yes","No")`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-a-time-is-between-two-times)

### Add st, nd, rd and th to numbers

`=A2&IF(AND(MOD(A2,100)>=11,MOD(A2,100)<=13),"th",CHOOSE(MIN(MOD(A2,10)+1,5),"th","st","nd","rd","th"))`

Excel. Result on the sample sheet: 11 rows (B2:B12). [See it and try it](https://spreadsheetpractice.com/formulas/add-ordinal-suffix-to-numbers)

## Questions

### What does the AND formula generator do?

You describe the task in plain English, and it writes the formula, using AND where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does AND do?

AND returns TRUE only when every condition you give it is TRUE.

### Can I learn to write AND formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the AND function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
