WPS Spreadsheets: Extract a Hijri Month Name from an Excel Date
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.
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.
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.
In WPS Spreadsheets, click the first cell where you want the Hijri month name to appear, such as B2.
Type =IF(A2="","",TEXT(A2,"[$-ar-SA]mmmm")) in the selected cell, replacing A2 with the cell containing the date, and press Enter.
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.
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.
Return the month name from a verified Hijri month lookup table
Use this fallback when TEXT does not handle Hijri dates consistently or when the workbook requires fixed month names.
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. Open the workbook: Launch WPS Office, choose Spreadsheets, and open the Excel workbook containing the date column.
- 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. 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. 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.

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.




