First time posting, though I have lurked around for quite some time.
I am trying to match specific information from a power query created table to another table. The data I am trying to pull can potentially repeat, so it needed to be a formula that would remove that. The current formula I am using is:
{=(OFFSET(Sales!$A$1:$A$100000,SMALL(IF(CONCATENATE($B$48,$O$3)=Sales!$A:$A,ROW(Sales!$A$1:$A$100000)-ROW(INDEX(Sales!$A$1:$A$100000,1,1))),ROW()-48),COLUMN()+2))}
and it was originally working for my test data. Once I pulled the data from the database using power query, however, I continue to get #value errors. The formula looks up a concatenated value on the power query worksheet compared to one created on the current worksheet.
Any advice would be appreciated.
Related
I hear so many good things about the FILTER function in Excel, but I can't seem to get on with it. More often than not I end up with a #VALUE error. I'll usually get to the bottom of it, but this one has stumped me.
This is the formula:
=FILTER(Sheet1[#All],IFERROR((Sheet1[[#All],[Account]]=$D$1)*(Table2[[#All],[Duplicate 21711000]]=0),0))
I've put the IFERROR in because I thought perhaps a bunch of #N/A in the results could be causing an issue.
I've evaluated the Formula, and on the array on the Include side, everything seems to be working perfectly. The Boolean logic has worked, the 1s and 0s are in the right place to theoretically filter my list down to the few records I want to see. But when I click evaluate the final time, and it applies those 1s and 0s to the rows in the array, it results in the #VALUE error, and that's obviously all I can see in the cell.
Any ideas where I'm going wrong?
By the way, the point of this is to help a client who regularly pulls off a report from her accounting system, and then manually filters, copies and pastes the lines for new transactions onto separate tabs on her spreadsheet, over about 30 accounts. My plan is to use Power Query to bring the report into a tab in her spreadsheet, then use the Filter function to bring across the appropriate rows from the Power Query Table into each tab. That's the first criteria here.
I've created another table next to the PowerQuery table which uses a Count If to work out if that line has already been imported. So the second part of the criteria filters the list if the CountIf has registered a duplicate.
I can't just use PowerQuery everywhere, because she needs to then be able to add more columns and manipulate the data once it's been imported. So the final part of the job is to create a macro to copy > paste values, obviously copying the filter function into the row below first, ready for next month.
So Power Query imports all the data, Filter function extracts the specific data into each tab, and Macro locks in that data ready to be edited if need be.
If anyone can think of a better way of achieving the same result, I'm all ears.
So thank you #JvdV, the simple answer was indeed that the two tables were of different sizes, and FILTER requires for them to be the same size.
This caused a follow up issue though that in order to count if I had any duplicates in the sheet, I couldn't go with plan A and use a separate table, because it wouldn't dynamically change it's height when the Power Query table was refreshed.
I looked into maybe incorporating the table into the Power Query in the first place with a custom column. But this would mean that the PowerQuery would end up with 39 additional columns, which would all be brought across by each FILTER function.
So instead I did this. I know this is very niche, so probably won't help anyone, but I'm very proud of myself and want to post it somewhere:
=FILTER(Sheet1[#All],IFERROR((Sheet1[[#All],[Account]]=$D$1)*IF((COUNTIF('21711000 (125006) Int rec'!$C:$C,Sheet1[[#All],[Document Number]]))=0,1,0),0))
(I probably don't need the IFERROR anymore, but it works, so I'm not going to touch it, and it might be safe just in case there ever are any errors).
So this uses the fact that Excel spills now rather than needing specific array functions. Before I made COUNTIF into a separate column, but now I'm putting it in here, and it naturally spills in the background, essentially creating that column within the formula. Then the IF changes any 0 to a TRUE (1), and any other number (my duplicates) to a FALSE (0), and everything works.
It actually creates a circular reference, because the Filter is in column C, but I think that's okay for my purposes, because I don't want it to include the results from the filter anyway. I suspected that might happen, but it seems to be working so far.
I hope that can help someone.
I am trying to set up a dynamic link between tables in Excel such that I can have a formula that returns who does a task on what day.
The two reference tables are one which lists the task and who is responsible for it, and the second provides a list of dates on which that task is carried out.
this would then feed into the final table:
The idea is that the formula in the final table should check the activity in the first column to return who does the task and also check whether the date in the first row is found for that activity in the second table listing all the dates for each activity.
I can only get so far using
=IF(ISNUMBER(MATCH(date_in_final_table,range_in_second_table,0)),"person","")
which works, but the problem here is I am hardcoding the value for the person. The first two tables could be changed anytime and I would like everything to update automatically.
I guess the answer is going to feature INDEX, MATCH and maybe a look up or INDIRECT, but so far I can't link everything successfully.
Can anyone help please?
Use:
=IF(ISNUMBER(MATCH(date_in_final_table,INDEX(full_range_in_second_table,0,MATCH(activity_in_final_table,title_row_in_second_table,0)),0)),VLOOKUP(activity_in_final_table,first_table,2,FALSE),"")
I am looking to have some summary stats for a table that is generated by a query on another tab, but all the approaches I have taken fail for some reason.
Using cell references - COUNTIF(INDEX(Errors!$A$2:$Y$692469,0,MATCH("INCORRECT",Errors!$A$1:$Y$1,0)),TRUE)
With this approach, when the table is generated, the references, even though they are anchored, adjust to the first column that is not part of the generated table.
Using structured references =COUNTIF(Errors[INCORRECT],"True")
This only works if the table already exists with that column. If it doesnt exist, excel wont even let me put in the formula. The formula error dialog pops and I cant save it there.
Creating a table stub that has the columns I want. For instance, I have a table with headers of ID, INCORRECT with one empty row. When I do it this way, the query ends up creating new columns (INCORRECT2) rendering the structured reference worthless.
So, any suggestions? One complexity is that the the table output does not have completely predictable column names. The ones that I want summary stats on are predictable, however, the other ones are not and in fact there could be a single other column or multiple. So that's annoying. I do know what the names (and quantity) of the other columns are. These are established connections.
So the indirect function was the way to go.
=COUNTIF(INDEX(INDIRECT("Errors!$A$2:$Y$692469"),0,MATCH("INCORRECT",INDIRECT("Errors!$A$1:$Y$1"),0)),TRUE)
I'm trying to work out a way of telling if any of the fields have an #Num! error in any of the rows of a linked Excel table.
The only way I can think of is by dynamically building a query which shows records from the table where any of the fields are equal to #Num!and seeing if the count of records in that query is more than 0.
I have only limited control over what is being put in at the front end so I'm trying to put some extra validation into my part before I use the results.
The errors are due to input in a few of the cells in that column being text of numbers and access has looked at the column and decided it's numeric but then doesn't then like those cells.
Anyone think of any less intensive tests?
I've used the solution here but for me it's not a very nice workaround. It leaves the linked excel in access having at least one row & column which I've then subsequently got around. You can't seem to pick up the #Num! in a query, if you do IsError([FieldName] it gives an error rather than True.
My table has a date column to to the left (Column A). Other columns have share quantities and values. Using standard VLOOKUP, I can retrieve values for a given date.
However: I have new transactions, which regularly need to be added to the master table. What I need is an "inverse" function, that allows me to append (or even over-write) data to the underlying table.
So far, my searches for an "inverse" function only give me alternate ways to retrieve (with the columns out of order). Any suggestions for an appropriate method?
If I understand you correctly, what you are looking for is a script that can add data to the end of a table, or change data on an existing cell. Functions only work by reading data in other parts of the spreadsheet and outputting the result in the cell that they were written in. I don't think you're going to find a formula that sends data to another part of the spreadsheet.
If a script is what you're after let me know. I use scripts like that so I can code a few code snippets.
Please check INDEX MATCH functions.