I have a massive Excel Workbook that I use for tracking product titles and descriptions, and I'm trying to get it to generate .csv files for importing those products into eBay and my own website. I'm 99% of the way there, but I can't seem to find the Excel equivalent of Google Spreadsheet's QUERY() function, and there are two spots I need to use it:
1st, I need to populate a column in SheetB with the Product IDs in SheetA that have not been listed on the site. In Google Spreadsheets, I would do this with =query('SheetA'A:B,"select A where isblank(B)") but I can't for the life of me figure out the equivalent in Excel.
2nd, I need to take all the non-blank rows from four different sheets and put them together into one sheet.
There has to be something obvious I'm missing, but I'm missing it. Help me, magical internet people, you're my only hope!
The bad news is that Excel does not have an equivalent of QUERY()
The not quite so bad news is that you can roll your own.
Some possible ways:
Move your data to a database. You can do the whole thing in the database, or still use Excel as a front end (eg by using Get External Data to query the db, or build it all in VBA)
Use AutoFilters to query your data (this is not SQL queries...). There a plenty of examples on SO of this technique
Use Get External Data (in spite of the name, this can be self referencing) to query your data (this is SQL queries) See this answer for a starter
Have a look at this short video of a 3rd party Query() function for Excel.
Here's a 5s "hello world" gif as well:
To install it, you'll need the QueryStorm runtime, which is a free 4MB installer. It's like a package manager for Excel. After you install it, go to the QueryStorm tab in the ribbon, click Extensions and install the "Windy.Query" package (as show in the video).
[Disclaimer] I'm the 3rd party (author of QueryStorm).
I was in need of doing the same, using INSERT>TABLE in Excel does the trick, from the table you create a pivot table and when you add columns and/or rows it the pivot
I know this post is 8 years old, but if anyone else is looking for a solution, you could try the following formula in cell C2
=INDEX('SheetA'$A$2:$A$10, SMALL(IF($D$2="", ROW($A$2:$A$10)-ROW($A$2)+1), ROW(1:1)))
This will look for empty cells in SheetA A Column and display ONE value in C2 cell.
If you want to extract values from B column, repeat the same formula but replace 'SheetA'$A$2:$A$10 with 'SheetA'$B$2:$B$10.
Cons: 1. you will have to copy this formula to the right and manually replace the first bit of the formula.
2. you must copy down the formula to as many rows as there are values in the SheetA to ensure you don't miss any values.
Finally: After entering the formula, press CTRL SHIFT-ENTER to convert it into an array formula.
Related
I'm practising MS Excel skills. I have a workbook in which I want to analyses data from different tables.
Each worksheet contains a table with the information from the year. So in worksheet "2017" I have a table named "Table2017". I have this for each year (starting 2015).
After a some research, I finally found a way to count how many times something in a certain place happened.
=SUM(COUNTIFS(Table2018[Place];B3;Table2018[Activity];{"Paid";"Awarded"}))
+SUM(COUNTIFS(Table2017[Place];B3;Table2017[Activity];{"Paid";"Awarded"}))
+SUM(COUNTIFS(Table2016[Place];B3;Table2016[Activity];{"Paid";"Awarded"}))
+SUM(COUNTIFS(Table2015[Place];B3;Table2015[Activity];{"Paid";"Awarded"}))
This works perfectly. It will calculate how many times per place a paid service or an awarded (gifted/sponsored) service was delivered. In the B column, I have a list of places (hence the B3 reference), so after completing the formula, I can select the cell and enlarge/drag to copy it to the rest of the column and apply for every place.
However, the formula is really long and every year upon creating a new worksheet, I need to add a new part to the formula.
Is there a way to compact this? And ideally have the formula search for every table that has the relevant information (like: "Table20??" or "Table 20*"), go in and count the times my conditions are found?
I hope my question is clear enough.
Thanks in advance!
P.S. I have zero experience in VBA/VBS, so I'm hoping to realize this in a normal formula.
There are ways to make it more compact, but they will necessarily make the function more complicated, so it wont be any easy win. See for yourself:
you basically need to be able to cycle through the years inside formula without creating custom formulas. One way to do this is to use ROW inside INDIRECT function. This way you can replace multiple
Table2015[Place]
with one array function containing
INDIRECT("Table"&ROW($A$2015:$A$2018)&"[Place]")
as it is an array function it will essentially cycle through the cells in the ROW function creating Table2015[Place], Table2016[Place], Table2017[Place] and Table2018[Place]. Your whole formula would look something like this
=SUM(COUNTIFS(INDIRECT("Table"&ROW($A$2015:$A$2018)&"[Place]");B3;INDIRECT("Table"&ROW($A$2015:$A$2018)&"[Activity]");{"Paid";"Awarded"}))
and it must be entered using ctrl+shift+enter (you will see {} brackets around the function). This should work to make the function smaller and you will need only to change the cell reference each year instead of adding another sum, but the question is if the separate sums are not easier to read and maintain.
I have a pretty extensive spreadsheet that stores data over many years, and to help culminate that data I have a had to make multiple summary pages to calculate the data one for each year. I want to instead make a single sheet that will summarize the data and the user can simple select the year they want to view from a drop down menu and all the formulas will automatically calculate the new data. From what I can tell this can be done by using the "indirect" function but I cannot get it to work and am starting to think that function will not work because of the way the formula works. Does anyone have a working method that will generate the desired results.
Manual Formula
=SUMPRODUCT((MONTH('W.A.R. 2016'!$A4:$A369)>=1)*(MONTH('W.A.R. 2016'!$A4:$A369)<=3)*('W.A.R. 2016'!$A4:$A369<=TODAY())*(ISNUMBER(FIND("Work",'W.A.R. 2016'!B4:B369))+(ISNUMBER(FIND("Wrk/Lve",'W.A.R. 2016'!B4:B369))/2)))
Formula im working on.
=SUMPRODUCT((MONTH(INDIRECT("'("&O2&")'!$A4:$A369"))>=1)*(MONTH(INDIRECT("'("&O2&")'!$A4:$A369"))<=3)*(INDIRECT("'("&O2&")'!$A4:$A369")<=TODAY())*(ISNUMBER(FIND("Work",INDIRECT("'("&O2&")'!$A4:$A369")))+(ISNUMBER(FIND("Wrk/Lve",INDIRECT("'("&O2&")'!$A4:$A369")))/2)))
In theory I cannot see why its not working but I think it the way indirect pulls the data.
I can spot a couple of issues.
This has unnecessary brackets around the sheet name:
INDIRECT("'("&O2&")'!$A4:$A369")
It will produce a string like: '(W.A.R. 2016)'!$A4:$A369
You just want to use:
INDIRECT("'" & O2 & "'!$A4:$A369")
There is some inconsistency in your formulas
The first formula searches for "Work" in B4:B369 and "Wrk/Lve" in B4:B369, whereas the second formula has the ranges swapped around.
The best advice I can give on trying to figure out where a formula is going wrong is using the Evaluate Formula tool.
Select the cell that has the formula, go to the Data tab on the ribbon and click Evaluate Formula. It will pop up a dialog that allow you to step through each part of the formula as it calculates. From there you should be able to see what's going wrong.
I'm looking for a little bit of help learning about how to use vlookup and iferror formulas together.
I am working as a licensing specialist within the insurance industry. My job requires that I frequently access more than a dozen spreadsheets that are emailed to us on a weekly basis from our clients. I am working to develop tools that allow us to consolidate that information on-demand to be able to run reports. I'm having no trouble using the VLookup function to pull data from various spreadsheets using an unique identifier. I do need some help, however, with a trickier formula.
I have put together a spreadsheet that allows me to put in the ID of the representative and it returns various bits of information, such as their name, license numbers, job codes, etc. Now I need to come up with a formula that takes the value returned in the job code field and searches another spreadsheet to return what training they are required to complete based on their job code. This spreadsheet is about 2000 rows, and is formatted with the training names spanning across the top row, job codes listed in column "A" and the word "yes" in each column that matches a training that the job code is required to take.
It looks like this: https://i.imgur.com/71COmfF.png
I need the formula in my reports spreadsheet to lookup the job code using VLookup and then return the column header if the cell has text.
The data will be loaded into this spreadsheet: https://i.imgur.com/2CyFURt.png
Here is the Vlookup formula I am using to get the job code:
=VLOOKUP(B3,'.\[Weekly_HR_Report_040615.xlsx]HR'!$A:$Q,10,FALSE)
How can I pair that same kind of formula with something like an IfError formula to return the column header if there is a "Yes" in the cell of the row that matches their job code?
I know that I can work through it as an array using VBA, but I would prefer to just place a formula in each cell so that I can pass this spreadsheet to another college when I move to a different role in the future and they won't struggle too much with adding to it.
Thanks for any help that you might be able to provide! I really appreciate it!
I would use INDEX and MATCH to cross reference and retrieve the titles where applicable:
=IF(INDEX('JobCode_Training.xlsx'!$A$1:$H$6,MATCH($H$5,'JobCode_Training.xlsx'!$A:$A,0),2)="Yes",INDEX('JobCode_Training.xlsx'!$A$1:$H$6,1,2),"")
=IF(INDEX('JobCode_Training.xlsx'!$A$1:$H$6,MATCH($H$5,'JobCode_Training.xlsx'!$A:$A,0),3)="Yes",INDEX('JobCode_Training.xlsx'!$A$1:$H$6,1,3),"")
=IF(INDEX('JobCode_Training.xlsx'!$A$1:$H$6,MATCH($H$5,'JobCode_Training.xlsx'!$A:$A,0),4)="Yes",INDEX('JobCode_Training.xlsx'!$A$1:$H$6,1,4),"")
etc.
I wasn't sure what your reference table is saved as, so you'll need to replace 'JobCode_Training.xlsx'! with whatever the correct path is.
Since you have multiple trainings that can apply to each jobcode, you'll either need to have multiple cells for the results, or you can concatenate them into one.
The following article from excelvlookuphelp.com answers your question I believe...
The Problem
You might be expecting that not all of your search values are going to return something from the search table. Instead of the formula returning #N/A you’d like the result to look different when your vlookup value isn’t found (either blank or an indicator to show that the value hasn’t been found or a zero if you’re wanting to do maths with the results).
The Solution
You can use the iferror function.
It works like this
= iferror (YourVlookupFormula, WhatToSayInsteadOf#N/A)
Here’s an example
=iferror(vlookup(D3,A:C,3,false), “No Value Found”)
Or if you would rather it was just blank then instead of having No Value Found, just have the two sets of inverted commas, like this
=iferror(vlookup(D3,A:C,3,false), “”)
source: excelvlookuphelp
i have a little problem with final formulas in one of my column. How to start. maybe i will explain what i have a then what i want.
i have an excel worksheet with 3 sheets. i want to record goods and what are these goods made of. first is sheet called Goods where is possible to put number of goods i want to make. In this case i want to make 1x sandwich1 and at the same time 3x sandwich2. i dont want make sandwich3 this time.
Second sheet is Matrix sheet where I record every good and what it is made of. This sheet is basic sheet and all other sheets take list of goods (resp. ingredients) from this sheet. Simply when i want to make sandwich1 i look at matrix and know that i need 1x1pc of egg + 1x5g of cheese. And for 3x sandwiche2 i need 3x10g of sausages.
Final sheet is called Ingredients. It is a list of used ingredients from Matrix sheet (exactly same order) to make these sandwiches. I want to fill formulas into column B which would go through one ingredient ofter ingredient and count needed amount of it. So it would look into matrix in the same row and where there is some number it would multiply with number of items from Goods sheet. The list of goods is also in the same order as in the matrix sheet.
I hope you understand now what i want and will try to help me. I think there will be SUMPRODUCT, SUMIF and maybe INDERECT functions but i am not that skilled in excel
thanks for any suggestions
You can use MMULT function here - it's an "array formula" which you need to enter in a range. You can do that like this:
In Ingredients worksheet enter this formula in B2
=MMULT(Matrix!C2:E4+0;Goods!B2:B4+0)
[I'm assuming you have a European version of Excel where ; is used to separate arguments]
Now select the whole range B2:B4, press F2 key to select formula and hold down CTRL and SHIFT keys and press ENTER. This "array enters" the formula in the range and you should now see curly braces like { and } around the formula and also the correct results.
You cannot change part of that array now, only the whole thing
Note that I'm assuming that the contents of Goods!A2:A4 will be the same as Matrix!C1:E1 and in the same order. You can extend the ranges to be as large as you like as long as that principle still holds
I suspect that this is an issue of "when all you have is a hammer, every problem is a nail". For reasons known only to you you are using a spreadsheet to solve a problem that databases were made to do. Any solution to this problem in a spreadsheet will be entirely dependent on the integrity of your data - add another column or get things out of order and it will fail.
That said, what you have in your link is effectively a pivot table and what you need is the unpivoted version of this - the instructions for getting this are here.
When you have that, you can use the various database functions in excel to get your answer.
Is there a quick/easy way to filter all unique items in an Excel 2013 column similar to the Google Docs "Unique" function?
This is not a pretty answer, but it works.
Paste this as an array formula into cell B2:
=LOOKUP(2, 1/((COUNTIF(B$1:B1, A:A)=0)*(A:A<>"")), A:A)
With the column that needs to be filtered in A:A
Then drag / copy it down as far as is required.
See it online in Google Spreadsheets
Caveats:
Does not retain original order (resulting order is in fact the reverse)
Does not automatically expand to cover all cells
Not fast, not pretty, not transparent
Footnotes:
It is trivial to use IFERROR() to filter out the #N/A errors, but I've not done this to keep the answer concise
In the same vein the header of the column A is currently also returned. This can be fixed by changing A:A to A$2:$25 in all 3 locations
Original question was for Excel 2013, all of this should work there, but I wrote and tested it in Excel 2016
I would love to hear suggestions on how to make the formula automatically expand down as far as required.
Use the Unique records only feature in Advanced Filter.
Under the DATA tab there is this: "Remove Duplicates". It'll do what you want.
There isn't an equivalent to =unique() in Excel, and I hate having to work without it.
Without =unique() trying to find all of the unique values in a large array of data is impossible. Take a dozen columns of a hundred+ entries and see what the unique values are across the whole mess and pop them nicely into a new columns. I can't figure out how to do it in Excel, but in Gdocs it's simple:
=unique(transpose(split(ArrayFormula(concatenate(A:M&",")),",")))
Using Filters, or PivotTables, or whatever, just doesn't cut it, and I haven't been able to find any hacked together ridiculous excel formula to do anything similar.
filter your data in spreadsheets
This might prove to be of some help to you.