# MOD formula generator

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

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

MOD returns the remainder after dividing one number by another.

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

## Tested MOD examples

### Add hours to a date and time

`=B2+C2/24`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/add-hours-to-a-date-and-time)

### Add minutes to a time

`=B2+C2/1440`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/add-minutes-to-a-time)

### Convert time zones

`=$F$1+B2/24`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/convert-time-zones)

### Find the remainder of a division

`=MOD(B2,C2)`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/remainder-of-a-division)

### Check if a number is a whole number

`=MOD(B2,1)=0`

Excel. Result on the sample sheet: 5 rows (C2:C6). [See it and try it](https://spreadsheetpractice.com/formulas/check-if-a-number-is-a-whole-number)

### Why does an overnight time difference show ##### or a negative number

`=MOD(C2-B2,1)`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/overnight-time-difference-negative)

### Get the date of the next Friday

`=A2+7-MOD(WEEKDAY(A2)-$E$1,7)`

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

### Count odd and even numbers

`=SUMPRODUCT(--(MOD(B2:B11,2)=1))`

Excel. Result on the sample sheet: 6. [See it and try it](https://spreadsheetpractice.com/formulas/count-odd-and-even-numbers)

## Questions

### What does the MOD formula generator do?

You describe the task in plain English, and it writes the formula, using MOD 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 MOD do?

MOD returns the remainder after dividing one number by another.

### Can I learn to write MOD 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 MOD 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.
