markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

Unable to extract currency from excel formatted cells

Open samiashi opened this issue 1 year ago • 4 comments

When I have an excel file with some cells formatted with currency, the conversion does not include the currency label. It only seems to extract the value.

For example an excel file with the following: Image

Returns: '## Sheet1\n| Unnamed: 0 | Unnamed: 1 | Unnamed: 2 | Unnamed: 3 | Unnamed: 4 |\n| --- | --- | --- | --- | --- |\n| Item | Count | Cost | Weight | Total |\n| Breakfast | 20 | 5 | NaN | 100 |\n| Laptops | 5 | 1199 | NaN | 5995 |\n| Car tires | 8 | 199 | 150 kg | 1592 |\n| NaN | NaN | NaN | NaN | 7687 |'

currency_label_invoice.xlsx currency_label_invoice_2.xlsx

samiashi avatar Dec 16 '24 08:12 samiashi

Hmm, good catch. The type and formatting info are in the cell metadata which might not be considered when we load the table via pandas. I'll see if there's an alternative approach.

afourney avatar Dec 16 '24 18:12 afourney

@afourney @gagb I have created PR #1325 for this issue

preetpatel26 avatar Jul 14 '25 13:07 preetpatel26

Hi! I would like to take this on (it carries the open-for-contribution label). Plan: in XlsxConverter, overlay Excel number-format currency symbols onto values (pandas drops number_format), so currency-formatted cells render with their label, plus a regression test with an in-memory workbook. Thanks!

aslamalkarywk7 avatar Sep 18 '26 23:09 aslamalkarywk7

Opened PR #2538 with the fix (currency-symbol overlay from number_format + regression tests). All green locally; pre-existing env failures unchanged. Happy to adjust the approach if you prefer a different rendering.

aslamalkarywk7 avatar Sep 18 '26 23:09 aslamalkarywk7