Rutba Office
Download

How to show Hijri dates in Excel, LibreOffice and Google Sheets

A spreadsheet keeps a date as a number and the calendar is only how it is shown. So a Gregorian date can be shown in the Hijri calendar by its format, without a second column or a conversion formula. Excel and LibreOffice each have a format code for it; Google Sheets has none, and needs a formula.

11 October 2026 · 5 min read

Why a format is enough

Excel and the other spreadsheets store a date as the number of days since a starting day, and the time as the fraction of a day. 1 March 2026 is the same number whatever calendar it is shown in. Showing it in the Hijri calendar is therefore a matter of the cell’s number format, which leaves the value alone: sums, sorting and formulas still work on the same day.

In Excel

Select the cells, open Format Cells (Ctrl+1), choose Custom and type a format. Excel reads two kinds of code for the calendar:

  • B2 before the date codes means Hijri, and B1 means Gregorian: B2dd/mm/yyyy shows the Hijri day, month and year.
  • A locale code in square brackets names a language and a calendar together. [$-60401]d mmmm yyyy shows the day, the Hijri month’s name in Arabic and the Hijri year.

In the Date category of Format Cells, choosing an Arabic locale shows a Calendar type list with Hijri in it, which writes the same codes for you.

Excel’s Hijri is a calculated calendar. Saudi Arabia’s official Umm al-Qura calendar and the calendars that follow the sighting of the moon can differ from it by a day at the start of a month, so check dates that matter, such as the first of Ramadan, against the official calendar.

In LibreOffice Calc

LibreOffice’s format codes take a calendar modifier: [~hijri] at the start of a date format, such as [~hijri]DD/MM/YYYY, shows the date in the Hijri calendar. It works when the cell’s language, chosen in the same Format Cells dialog, is an Arabic variant. LibreOffice’s help page on number format codes lists the modifiers.

In Google Sheets

Google Sheets has no Hijri date format. The usual ways round it are an add-on from the Workspace Marketplace that converts dates, or a column worked out with a conversion formula. Either way the Hijri date is a separate value, so keep the Gregorian date beside it for sorting and arithmetic.

Arabic-Indic digits

A number format can also choose the digits. In Excel, [$-2000000] before a format writes the number in Arabic-Indic digits (١٢٣) and [$-3000000] in the Persian and Urdu forms (۱۲۳). Whether a file opened elsewhere shows them depends on the other program reading the same codes.

Our own product, disclosed

Where our own software comes into this

Since version 1.41.0, Worksheets in Rutba Office reads and writes Excel’s Hijri formats, B2 and the locale codes, following the Umm al-Qura calendar, so a file Excel dates by its own reckoning can differ from it by a day. It writes [$-2000000] and [$-3000000] for Arabic-Indic and Urdu digits too, and in an Arabic or Urdu window the number format list offers Hijri date, Hijri long date and the language’s own digits. Calendar can show the Hijri date beside each day.

Download it free →Compared with the alternatives →

Ten apps, one free download

No account, no telemetry, and it works with the network switched off.

One family

The rest of Rutba

One account across all of it. Sign in once and the products know each other.

OFFICE-ARTICLES-DETAIL · 7596826