Showing unique values in a column along with another value associated with each - excel

I have an Excel table containing transactions of companies. It looks like this:
Customer Phone Item Price
==================================
Company1
Company2
Company1
Company3
Company1
I need to see the unique values of customer column.
The result I want is:
Customer Phone Item Price
==================================
Company1
Company2
Company3
Here is what I tried already:
Remove duplicates: To just get the unique values, I can use the remove duplicates of excel. However, since this is something I will be doing frequently, I would rather not have to make a copy of the table each time in order to delete duplicates.
Pivot table: A pivot table does this job perfectly. My problem here is that I need other column info as well (e.g., the phone number) which I want to appear in the column next to the company. [I haven't yet figured out how to do this in a pivot table (i.e., to show a value as text instead of sum or count etc.)] - This would be the best option for me.

As long as you don't have a super long table where the recalculation will kill you, you could just add a calculated column like this and then filter on value being 1:
=IF(COUNTIF($B$1:B2,"=" & B3) > 0,0,1)
If recalculation is an issue, you can use the same or similar method with VBA except paste static values.
PivotTables are well suited for this kind of stuff, so that'd be my first go-to, but PivotTables are also frustratingly difficult to adapt to uses beyond their envisioned use... so there's a steep decline in their usefulness as you stray from that.
Ultimately, you may want to consider a relational database paradigm, and/or using Access. That's one step up the sophistication ladder towards managing the kind of data you're talking about.

Related

Excel sheets with scores by same ID of person (Kahoot) - How to extract and summarize scores from several quizzes?

I've used Kahoot in the classroom and have several excel files with scores from quizzes.
Students attended quizzes by using unique IDs. In each file, scores are visible for each ID (but ordered by success on each quiz). There are also some students missing or stating wrong IDs (I'll ignore it).
Now I would like to accumulate all scores for all student IDs in one sheet and summarize them by Student ID.
How can I do that most efficiently?
Any pointer or advice is appreciated.
Thanks,
B.
Here's a high level guide to getting what you want along with a sample in this file.
Step 1 - Combine Files to Sheet with Unified Columns
Objective
The goal here is to:
Combine all of your data from other files to single sheet
Merge the data to be in a single column for each field (i.e. Column A has ID, Column B has score).
No breaks in rows.
No formulas.
To illustrate, I made this fake list based loosely on your
description.
Method
You probably can do this manually, but a macro could also be used. If you expect to do this year over year, you might look into vba to open close files in a folder. However, since that wasn't part of question, you can do copy-paste (better yet make a kid do it!). Just make sure there's only one header for each column, and all of the data records align. Probably should do copy paste value if you have any formulas.
Step 2 - Show Summation
There's a couple ways this could be done. A pivot table is probably the most sensible because you could include each quiz as a column to see the total. You could also use a pivot table to do averages by student etc.
TO make a pivot table, I would recommend going on YouTube and they will do a better job of explaining than me.
On that same file I made as an example, I included some tabs to illustrate the power of pivot tables and a couple graphs.
Hope that helps. If you have specific technical questions on this, you might consider asking separately.

Excel XP for inventory management Simple in theory but can't achieve it

I need to create a simple and easy to use inventory management sheet or database.
It may be better to use access as I see it, but people is more familiar using excel.
Imagine a warehouse where we store goods. Goods are often delivered so I have to reduce the stock cound for a particular item. Then if the warehouse is short in some goods, more of these are bought.
The thing is I need to store a history of delivers we make but also store per item the actual count.
I thought having a column for initial items count, then add ins and subtract outs.
I tried using db functions, dynamic tables etc, but the problem is that when I add new registries for new item outs and ins, the dynamic table wont resize it's source and the same for range for functions.
What would be the best way to achieve what I want?
The thing is that we do everything manually, counting, summing and subtracting each time we have ins and outs.
I didn't want to make something overcomplicated to use, but rather save time by automatinc the ins and outs calculations and making it easier to search for particular registries.
You can do this with an Excel Table and a pivot table (or some formulas). The columns should include date, item code, transaction type (coming in or going out), number of units. You can add columns with more information.
Next, enter a starting stock for each item code. Then enter new lines for each transaction. If you have bought new stock, put a positive number into Units. If you have sold or delivered stock, put a negative number.
Then you can build a pivot table that calculates the totals per item code (or use formulas). You can build other pivot tables to calculate values per month or using other data you may want to include in the data entry table.
An Excel Table will automatically adjust formulas and formatting to new rows. If you base the pivot table on the Excel Table, you only need to refresh the pivot table after you have entered new data. If you prefer formulas, you can use Sumifs(), but you need to keep the list of items for the stock totals list up to date manually.

Excel pivot table with ranking

I'm in the processing of creating a report for the company I work at that has a rather complicated survey export file that needs to have the data extracted in meaningful ways.
The table headers are as follow https://docs.google.com/spreadsheets/d/1Et9Pg6k9CJA3HTO0aHcnSnOWVU05bmHYUsPS0wB2Nr8/edit?usp=sharing
It has respondents listing there top 3 most important options and the rest are left blank.
If anyone can help me figure out a way to potentially summarize this in a pivot table that would be great.
You're data is in a crosstab. Pivot's don't like that kind of layout. You need to unpivot your data.
If you've got the PowerQuery add-in installed (or have Excel 2016 or Excel/Office 365 subscription) then you can use PowerQuery to do this. Google "PowerQuery" and "Unpivot" and you'll turn up a whole heap of videos.
Otherwise you can use VBA such as my Unpivot routine I've previously blogged about at http://dailydoseofexcel.com/archives/2013/11/21/unpivot-shootout/
As always it depends what questions you want to ask in your analysis. Here are two suggestions.
What are the commonest first/second/third choices?
This assumes that the ranking is important, i.e. the first choice is ranked significantly higher than the second choice, so you want to analyse them separately.
You could add three extra columns to your data using this formula to convert the first choice to a single variable with 11 categories
=IFERROR(MATCH(COLUMNS($A:A),$A3:$K3,0),"")
in L3 and likewise with the second and third choices in M3 and N3.
in the event that a respondent (row) has less than three choices, it will give a blank for the second and/or third choice.
What are the commonest choices regardless of ranking?
This assumes that the ranking isn't so important - you just want to know which columns have been picked overall.
=INDEX($L$3:$N$10,INT((ROWS($1:1)-1)/3)+1,MOD(INT(ROWS($1:1)-1),3)+1)
In N3. This would have to pulled down for 3N rows, where N is the number of rows in the original dataset.
Then it would be a simple case of setting up pivot tables or charts for the four new variables.

Unable to Create a Sub-Total in the POWERPIVOT

I am pretty new with POWERPIVOT tables. I have searched for a bit of time now to resolve my problem but I have been unsuccessful so far. As you can see below, I have created a POWERPIVOT table in Excel 2013 that is composed of two FACT tables, which are based on: 1) a sheet where the clients can insert vote 1 budget entries; and, 2) another sheet where the clients can insert vote 5 budget entries. Also, a few DIMENSION tables have been added to the combination in order to link the Branch names and the expenditure type. Please note that this is only a simple example of what I am trying to produce.
However, my main problem is that I can't add a sub-total that would sum Salary, Operating and Revenues for Vote 1 and Vote 5 separately. What I would like to show is the following:
Please note that I have tried calculated columns and calculated fields at the best of my knowledge but the results are always showing another set of columns for Salary, Operating and Revenues but what I need is just one column that sum the three components so it displays Salary, Operating, Revenues and Sub-Total. Does anyone know how to resolve this problem that I am facing since a long time?
Thanks to gurus.
I would suggest that you start by putting both budgets in the one table and an extra column to designate Vote id., Otherwise I fearyou will need to add a calculated column concatenating the Branch and Expenditure Type in each table, then doing a LOOKUPVALUE from Vote1 on the concatenated column to Vote5 and pull back the value.

How do I create report-like data tables in Excel?

In the past I have created websites that extract data from a database and format it using tables.
Now, I am trying to do the same thing but with Excel, and I'm lost. I am used to using SQL commands to extract data from given fields and then sort/manipulate it.
Currently, I am able to print a report that provides me with an Excel spreadsheet full of raw data, but I would like to make my life easier and organize it into a report.
The column that I would like to reference contains duplicates, but the data in the adjacent columns is different.
To give an example, assume I had a spreadsheet of sales transactions. One column would be the Customer ID, and the adjacent columns would contain the quantity, the cost per unit, total cost, order ID, etc.
What I would want to do in this case would be to select all the transactions with the same Customer ID and add them together based on their Order ID. Then, I would want to print the result to a second sheet.
I realize that I can use built-in functions to accomplish this, but I would also like to format this report evenually using VBA. Also, since I will have a variable number of rows that differ from one report to the next, I haven't encountered a fucnction that will allow you to add rows.
I'm assuming this must be done with VBA.
Well you can do it manually, but it would take ages. So VBA would be good, particularly as you would be able to generate future reports quickly.
My interpretation of what your saying is that each row in your report will be the total for one customer ID. If it's something else, I imagine the below will still be mostly relevant.
I think it would be a bit much to give you the full answer, particularly as you haven't provided full detail but to take a stab at what you'd do:
Create your empty report page, whether it be a new worksheet or a new workbook
Loop through the table (probably using While next is not empty)
a. Identifying if a row is for a customer ID you haven't covered yet
i. If so then add a new entry in your report
ii. Else add it to the existing customer ID record (loop through until you find it)
Format your report so it looks pretty, e.g:
a. Fill the background in white
b. Throw in some filled bars
c. Put in good titles and totals etc.
For part 1, it might be better building an array first and then dumping the contents into the report. It depends how process intensive it will be - if very intense, an array should shave off time.

Resources