Forum Discussion
extracting the name of the Hijri month from the Hijri date problem
I have a partial understanding of your Islamic month problem. The Excel function MONTH returns the month number on the Gregorian calendar, even if your cell is formatted to display a Hijri date. So your formula in column E should use different code to calculate the Islamic month number (probably using a combination of the TEXT and VALUE functions), and then do the conversion to romanized month name. Try this:
=IF(ISBLANK([@date]), " ", CHOOSE( VALUE( TEXT([@date,"b2m") ), "Muharram", "Safar", "Rabi' al-Awwal", "Rabi' al-Thani", "Jumada al-Awwal", "Jumada al-Thani", "Rajab", "Sha'ban", "Ramadan", "Shawwal", "Dhu al-Qadah", "Dhu al-Hijjah" ) )I have not tested that, but I used similar formulas in columns F and K in the attached workbook. The Islamic month names in the formulas are copied from an English-language Wikipedia article; I see that at least one of yours is somewhat different.
I do not understand details of the meaning of the "b2" prefix you are using, nor the meaning of the "[$-,106]" prefix that SergeiBaklan used in this post. (Neither seems to be a language code or an LCID. I cannot find Microsoft documentation on them.) Perhaps you will provide a little more information on the "b2", to educate me.
Your sample dates in column C include some dates (for example, 1445-02-30) that do not exist on the Tabular Islamic calendar, according to the "Kuwaiti algorithm". See the attached workbook for generated sequential dates. Maybe your source contains observation-based dates instead of rule-based dates. If so, someone else may be able to make a recommendation.
- SergeiBaklanDec 28, 2023Diamond Contributor
I'm not sure about the documentation, some explanations are in comments here What does the 130000 in Excel locale code [$-130000] mean? - Stack Overflow
When needed I select locale/calendar by Ctrl+1 on any cell with date and after that play with custom format.