Skip to main content

How to Enter a Formula in Excel

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

An Excel formula is a calculation in a cell. It always starts with =, it can use other cells by their addresses, like B10, and when you press Enter the cell shows the result while the formula stays behind it. This guide enters one that turns a shift's start and finish into hours.

The example is from the Clock change sheet in How to Calculate Hours Worked Across a Daylight Saving Time Change in Excel. A10 holds a shift's start, 24/10/2026 22:00, and B10 its finish, 25/10/2026 06:00.

Prerequisites​

  • A workbook open in Excel, here Excel for the web.

Step 1: Select the Cell for the Result​

Select the cell where the answer should appear, here C10.

Step 2: Type the Formula​

Type = first. Everything after it is the calculation:

Clock change → C10
=(B10-A10)*24

As you type, Excel colours each cell reference and outlines the cell it points to in the same colour: B10 in blue, A10 in red. The formula also appears in the formula bar above the grid:

Cell C10 being edited with =(B10-A10)*24, B10 shown in blue and A10 in red, the cells B10 and A10 outlined in the same colours, and the formula bar showing the same formula with the Cancel and Enter buttons next to fx

What the formula says:

  • B10-A10 is the finish minus the start, the time between them as a fraction of a day.
  • The brackets make Excel do the subtraction first.
  • *24 multiplies by 24 to turn days into hours.

Step 3: Press Enter​

Press Enter, or select the tick next to fx in the formula bar. C10 now shows the result, 8. Select it again and the formula bar shows the formula, =(B10-A10)*24:

Cell C10 showing 8 and outlined in red, with the formula bar showing =(B10-A10)*24

If you change A10 or B10, C10 recalculates by itself. That's the point of using references instead of typing the numbers.

Common Mistakes​

MistakeWhat happensDo this instead
Leaving out the =Excel stores the text (B10-A10)*24Start every formula with =
Leaving out the bracketsB10-A10*24 multiplies first, then subtractsBracket the part to do first
Typing the numbers instead of the cellsThe result doesn't update when the data changesRefer to the cells

Troubleshooting​

SymptomLikely causeFix
The cell shows the formula as textIt doesn't start with =, or the cell is formatted as TextAdd =; set the format to General and enter it again
The result looks like a date or a timeThe cell took a date or time formatChange its Number Format to Number: Fixed: Excel Shows Hours as 12:00 or 00:00
#VALUE!One of the cells holds text instead of a date or numberCheck the cells the formula uses

FAQ​

Can I click cells instead of typing their addresses?​

Yes. After =, select a cell and Excel types its address for you.

How do I cancel a formula I'm halfway through?​

Press Esc, or select the X next to fx. The cell goes back to what it held before.

Conclusion​

Select the cell, type = and the calculation using cell addresses, then press Enter. The cell shows the answer; the formula bar shows the formula.

Additional Resources​