Function Problems

WPS Spreadsheets: Extract a Hijri Month Name from an Excel Date

Maira MehtabMaira Mehtab Nov 12, 2026 869 views

Question details

The user needs to extract the Hijri month name from a date without errors on the 29th or 30th day of certain Hijri months.

Product
WPS Spreadsheets
Device & OS
not provided
Scenario
A workbook contains dates that should display their corresponding Hijri month names, including dates near the end of lunar months.
Observed behavior
The TEXT function can return an error or an unreliable month name when a Hijri format such as b2mmmm is used for some dates.
Before you start

Confirm whether the date cells contain real date values rather than text, and check the workbook's regional and calendar settings. Keep a small test range containing dates from several Hijri months, including 29th and 30th days, to verify the results.

Solution 1Recommended

Use a locale-specific TEXT format for the Hijri month name

Use this method when WPS Spreadsheets recognizes the stored value as a date and supports the Saudi Arabic calendar format.

The returned month depends on the workbook's regional settings, calendar system, and stored date value. A locale-specific format is more dependable than a general Hijri format code, but verify the output against the calendar system used by the workbook.

1
Select the month-name column

In WPS Spreadsheets, click the first cell where you want the Hijri month name to appear, such as B2.

2
Enter the locale-specific formula

Type =IF(A2="","",TEXT(A2,"[$-ar-SA]mmmm")) in the selected cell, replacing A2 with the cell containing the date, and press Enter.

3
Fill the formula down

Select the cell with the formula and drag its fill handle down the column, or use Home > Fill > Down to apply it to the remaining dates.

4
Verify boundary dates

Compare results for the 29th and 30th days of several Hijri months with the calendar system used by the workbook. If results are inconsistent, use the lookup-table method below.

Calendar settings affect the result: Do not assume that MONTH(A2) returns a Hijri month number. MONTH normally follows the underlying calendar system of the stored date, so use it for a lookup only when the value is already known to represent a Hijri month number.
WPS Spreadsheets

Extract Hijri month names reliably in WPS Spreadsheets

WPS Spreadsheets lets you test a locale-specific TEXT formula, fill it across your date list, and switch to a verified Hijri month lookup table when regional settings cause inconsistent results. It preserves common Excel formulas and supports familiar spreadsheet workflows.

  1. 1. Open the workbook: Launch WPS Office, choose Spreadsheets, and open the Excel workbook containing the date column.
  2. 2. Test the Hijri formula: Select a blank result cell and enter =IF(A2="","",TEXT(A2,"[$-ar-SA]mmmm")), replacing A2 with the date cell.
  3. 3. Check the output: Fill the formula down and compare dates from the 29th and 30th days of several Hijri months with your approved calendar.
  4. 4. Use a lookup table if needed: Create a two-column Hijri month table and use XLOOKUP or VLOOKUP with a verified Hijri month number when the locale-specific formula is unreliable.
Use locale-aware TEXT formulas to display Hijri month names from recognized date values.Keep a fixed 12-month lookup table for consistent results when calendar formatting varies.Open and edit Microsoft Excel .xlsx workbooks with familiar formulas and spreadsheet tools.Work in a lightweight spreadsheet interface with practical formula and table features.
microsoft office alternative - wps office

Frequently Asked Questions

Why does TEXT fail for some 29th and 30th Hijri dates?

The result can depend on the workbook's regional settings, calendar system, date storage format, and the supported format codes. Some lunar months have 29 days and others have 30, so test the formula against the calendar system used by the workbook.

What formula extracts a Hijri month name from a date?

Try =IF(A2="","",TEXT(A2,"[$-ar-SA]mmmm")) in WPS Spreadsheets, replacing A2 with the date cell. This works when the value is recognized as a date and the locale-specific calendar format is supported.

Can I use MONTH to get a Hijri month number?

Only when the stored value is already represented in a Hijri calendar system. MONTH normally returns the month from the underlying Excel date system, so use a verified Hijri month number or a calendar conversion before performing a lookup.

How can I avoid TEXT errors completely?

Create a lookup table containing Hijri month numbers and names, then use XLOOKUP or VLOOKUP with a verified Hijri month number. This separates month-name display from regional date-format behavior.

What should I do if XLOOKUP is not available?

Use VLOOKUP with an exact match, such as =IF(A2="","",VLOOKUP(B2,$H$2:$I$13,2,FALSE)), where B2 contains the verified Hijri month number and H2:I13 contains the month lookup table.