Excel populate table from same workbook - excel

I have a table on Sheet1. I want to pull in data into this table based on entry in another tab.
For example, I have a table
based on information in other tabs, I want to populate the Score column.
Can this be accomplished using SQL query or Powerquery (pseudocode- Select "Score" from other tab where Name = Jack )
I can look for events in VBA when if data is entered in the other tabs it can grab it and paste it in this table but it seems messy.
The reason I want to do this is, there are multiple tabs where people can enter their Scores. They cannot enter this in the main tab otherwise I wouldn't have a problem.

Load all datasets from your worksheet to PowerQuery and keep them as connections only (w/o loading to worksheet) except the one that you want to populate with the data in the end. After loading you can merge different datasets using selected columns as the key for joining. The result of the merge would be a table from which you could retrieve particular columns of interest.

Related

How can I generate a pivot table using this data?

I have this table:
Is it possible to make a pivot table to present the information like this?:
Thanks!
Sure it's possible. As shown in your example, you just need to change the special character "✔️" by the number 1 using "ctrl + f". Then insert a Pivot Table with the data. And finally, create a new column named TOTAL and add the "=sum()" formula to count the items from each row. Something like that:
You are going to need to move this data from the word doc you are using into an Excel worksheet, in order to generate a pivot table.
format your data like this in Excel
To start out creating a pivot table, make sure that all rows and columns are selected and record (row) must not be obscure or elusive and must be making sense. Navigate to Insert tab, click PivotTable.
You will reach Create Pivot Table dialog box. Excel fills in data range from first to last selected columns and rows. You can also specify any external data source to be used. Finally choose worksheet to save the pivot table report.
The pivot table should appear. You can then populate this table with data fields which will pop up on the right hand side. Enable the fields you wish to compare in the pivot table report.

Power Query Load table-type data to individual Excel Worksheet

Hi I am trying to load table records of a power query table to my Excel Workbook.
I have this transformed table in Power Query wherein Table in the Records column are table objects that contains data fetched from a REST endpoint.
I want to load the Tables to worksheets which I will be naming based on the WorksheetName column.
I have a worksheet that will contain the payload for the request and in the VBA which will be triggered by a click of a button, the Worksheet creation + population will occur.
Is there a way of doing that in VBA? I tried searching for a comprehensive way of doing that but I cant find any.
Thank you very much.
Are the sheetnames variable based on userinput? I had a similar issue, I just created the sheets, loaded the query to them and removed all but the first two rows (to prevent the file not getting slow).
Then when a user clicks the button, the VBA will unhide the sheet and refresh the query.

Excel : Selecting data and keeping it up to date

Ugh,
I'm not a hero when it comes to Excel...
I have an Excel file with one sheet that contains all data. It's basically a list of tickets, displaying the ticket ID, type, value and 5 dates per row.
I'm looking for a way to have new sheets in the Excel that actually display only tickets of a specific type. So on the sheet Bug Tickets I want to diplay like a filtered sub-set of the raw data in the first sheet.
However, this new sheet needs to refresh it's data automatically when I add new data to the main list.
Is this possible in Excel?
Ok here is a way using a Pivot Tables and Tables.
You should set it up like below: (in the SS, I put the pivot in the same sheet but you can put it in another).
Steps:
You need to create a table out of your data. See here on how to do it.
Then create a Pivot Table out of your table. See here on how to do it
After that you just need to format it the way you want.
The Pivot table will update everytime you add data on your table.
It will display what you've filtered.(in my example I filtered type A).
Notice: Apologies I cannot create a step by step procedure for you(very tedious). I wouldn't have posted this as answer if only it would fit as comment.

Displaying a portion of a table in a separate worksheet

On my first worksheet in the workbook, I have a large table with multiple columns and rows (roughly a 1000 rows and 20 columns).
I was wondering if it is possible to display part of this table in another worksheet in the workbook based on the criteria from one of the columns in the main table.
To help explain this, I will use an example from the actual workbook.
On worksheet 1 (called General Employee Info which is the main table), in Column A each row has a unique number identifying an employee (each employee has their own ID number).
Column B holds their office location (a city/municipality). Column C holds the state the office is in. Column D holds their salary amount per year.
There are multiple more columns with this type of employee information, which needs no further explanation.
My question is, can I label Sheet 2 in the workbook "New York State" and have that sheet display all the same information as Sheet 1 (all the same columns) but only display the employees that work in the state of New York?
And then have another sheet labelled "California" and have only the employees that work in California on that sheet and so on... In other words, have a separate sheet for each state.
It's essentially like filtering the main table using the State column to show only one state, but I want the results in a separate sheet instead of filtering the main table which holds all the information.
I was thinking of using a pivot table in each new sheet, but am not sure that's the right approach.
Is this possible? I hope I was clear in explaining the problem.
I really recommend using the excel tables feature if you are using Excel 2013 or later as a starting point. Tables rock for many reasons, including making your sheets more readable for users, and making formulas for things like INDEX/MATCH much less error prone.
Once the tables are in place with the main data, to subset I use the data modeling capability to link back to those tables.
These steps in Excel 2013 - version active around 2018. It's changed in Office 365 (see below)
create a sheet, or go where you want the table in your current sheet.
click the 'data' tab and select "connections" in the connections section.
from there select the drop down on the add button and select Add to Data Model..
Connections Dialog
Click the tables tab. Click the table you want.
now close the dialog
on the data tab, click Existing Connections in the "get external connections" of the data tab.
Click the Table tab
Select the table you want
Select the table radio button
hit return (or new sheet or a different cell if that's what you want)
poof your table from another sheet is now reflected in the current worksheet.
At this point you can subset using data slicing, hide columns, insert new columns with new formulas on the right or left edges of the table, etc.
You do have to refresh this separately using the 'refresh all' button on the tool bar.
In Excel as of October 2019 as (Thank you Josh for point this out!) It's gotten better as they include some of the 'power' tools in excel, and made a toolbar item that gets to the functions. Specifically:
Create a Table with the source data by selecting the data in the sheet, and using insert Table.
Select the Table
On the Data Tab click the small icon in the lower middle with the tooltip "from Table/Range"
This will Open the Power Query Editor. Microsoft has a tutorial; but it looks a little different now
After you've built your query; press "Close and Load" in the editor. Without options it will create a new sheet. If you choose the option with the ellipsis you have a few other options.
There is a variation of what you are trying to do here : http://www.get-digital-help.com/2009/09/28/extract-all-rows-from-a-range-that-meet-criteria-in-one-column-in-excel/
If all your data is on Sheet1 and you define a range (CTRL F3) which contains all the elements called [tbl]
In Sheet2 In cell A1 enter the column number that you are searching Sheet1
In Sheet2 in cell B1 enter the search criteria (ie, the State you want to filter by)
From Cell A2 to Z1000 (for example) enter the following array formula (So enter using CTRL SHIFT RETURN)
=INDEX(tbl, SMALL(IF((INDEX(tbl, , $A$1, 1)=$B$1), ROW(tbl)-MIN(ROW(tbl))+1, ""), ROWS(A2:$A$2)), , 1)
One key point to note in the execution of this is to create the array for the first row first, CTRL SHIFT RETURN to create it, then drag it down. Doing it in the wrong order won't increment the row counter at the end of the function properly. Just follow the instructions at the link at the start of this post and your should get it.

How to select entire excel spreadsheet for pivot table?

I want to be able to select and reference all of the tabs in my excel spreadsheet (to get totals of everything), but the data source only allows one tab to be selected... is there a way to select and use the entire workbook in the pivot table?
Thank you!
You actually just have a data formatting problem. You're using tabs to separate devices by departments instead of simply creating a department field/column and putting everything in one tab. The data was likely delivered to you that way, but don't let the delivery format define the true working format of the data.
Combine everything in one tab, and then you'll be able to use the data in a pivot table just fine.
If you have more data than will fit in a tab, put it in a database such as MS Access, MS SQLServer or mySQL, and then tell excel to use the database as the pivot table source.
I think Jonathan M has the best answer, but here's a way to do it using SQL that I've used successfully.
I don't know any easy way of doing this, but you could write a macro to copy and paste all your existing sheets onto a single new sheet (assuming there's enough room on a single sheet).
In 2007 Multiple Consolidated Ranges isn't in the default pivot table window. You need to create your pivot table, click on it, hit Alt + D, then P. Click back to step one and you'll have the option for multiple consolidated ranges.
Select the data on any of the one sheet and hit Alt D > P. It will show you Step 1 of 3 for PivotTable Wizard. Now select Multiple Consolidation Ranges and hit Next.
Select and add different fields from different tabs and it will create a consolidated range for your PivotTable and then you can run your PivotTable based on data located on different tabs of sheet at the same time.
Hope it helps.

Resources