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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,975
Messages
6,122,537
Members
449,088
Latest member
RandomExceller01

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