Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
TommyMossberg
Helper I
Helper I

Randomly getting "DataFormat.Error: Ogiltigt cellvärde: #VALUE!." on files with same template.

Hi

I have a bunch of Excel-files made with the same template. I use the following formula in cell H8:

 

=SEQUENCE(1, XLOOKUP(EXTRACT(CELL("filename", A1), FIND("]", CELL("filename", A1), 1)+1, 255), Months[Month], Months[Sequence]), XLOOKUP(EXTRACT(CELL("filename", A1), FIND("]", CELL("filename", A1), 1)+1, 255), Months[Month], Months[Start]), 1)

 

In short it finds the name of the sheet and translate it into a Date. Then the sequence populates a calendar in the format YYYY-MM-DD where the length depends on what month it is.
This works perfectley fine but when I try to combine each sheet from multiple files in Power Query I get a random Error (DataFormat.Error: Ogiltigt cellvärde: #VALUE!.) in cell H8 and null in cell I8, J8 (and so on) instead of the numeric value of the date created with the formula above. This applies to about 1/10 of the files. 9/10 works perfectly fine!

OverviewOverview

2023-02-28 18_21_06-sedczc9059175.png

WorkingWorking

The files are from the same template and I can't figure out why this is happening. 

Anyone has any suggestions of where to start?

1 REPLY 1
Anonymous
Not applicable

Hi @TommyMossberg ,

 

This is usually an error caused by a mismatch in data type.

 

Please see if these help.

How to correct a #VALUE! error

Error handling - Power Query

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.