Possible to return error values in PQ?

cr731

Well-known Member
Joined
Sep 17, 2010
Messages
611
I am using Power Query to review an Excel file and look for any error values (such as #NA , #VALUE , etc.).

When PQ imports these, it converts the cell to Error. If returned to the Excel worksheet, these cells become null.

I'd like to know if it's possible to have PQ actually return the cell value. Essentially I would want to keep the rows with errors and then return those exactly as they were input to show the user where there are errors. But it seems like PQ won't import #NA and allow it to be returned in a query.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
You can add a custom column that extracts the error

for instance, if you have a table with just two columns: Name and Age. And Age could potentially contain #N/A errors, you could do:

Code:
let

    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],


    AddCol = Table.AddColumn( Source, "AgeErrorChechk",
                                                each
                                                let
                                                    T = try [Age]
                                                in
                                                    if T[HasError] = true then T[Error][Message] else T[Value]
                                            
                           )
in
   AddCol
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,737
Members
449,050
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top