pivot table in excel dynamic coumn titles - excel

I have data in the following form
userID course groupNumber
===========================
111 A 90
111 B 89
234 A 90
234 B 99
234 C 67
I want to convert it to the following form for using it in other program that require it in the following form
userID course1 group1 course2 group2 course3 group3
============================================================
111 A 90 B 89
234 A 90 B 99 c 67
I am not sure if I can do it using pivot table since I do not know how to label the header of columns as course1 group1 ...and I do not know for sure number of courses and groups but I can estimate it if needed.
can I do this in Ecxel ? please direct me since I am not sure what I should search for in google, is this dynamic pivot table?
I am trying also to do it in sql but I still searching it
Note sorry I could not kwno how to format it properly
thanks

There is a very easy answer: you should keep the table as is, and use an excel pivot table in the following way:
Columns: GroupNumber
Rows: UserID, Course
Values: COUNT(GroupNumber)

Related

extract values based on two columns

I would like to extract a price value based on two other columns. In table 1, I am given the raw data where I want to draw from. In Table 2, I am given only the contract number, and I would like to find the type being "Mater" and have the price listed out for it.
I've tried to use this formula but I don't think I am calling the columns correctly.
=IF(AND(Table2!A1=Table1!$A$1:$A$6,Table1$C$1:$C$6="Mater"),Table1!$D$2:$D$6,"")
Is there a formula using index match, if(and), or another one that could work in this case?
Thank you!
Table 1.
Contract
Work
Type
Cost
5321a
aaa
Labor
52
5321a
ab
Mater
57
5641a
aba
Mater
10
536451a
aae
Labor
75
2441a
aan
Labor
42
53421
aar
Mater
14
Table 2
Contract
Mater Cost
5321a
57
5641a
57
53421
14
The following should work:
=SUMIFS(Sheet1!D2:D7,Sheet1!A2:A7,A2,Sheet1!C2:C7,"Mater")
(I'm assuming the first table in on Sheet1)

Order a structure in ColdFusion

I have a structure in ColdFusion in the format:
Jonh 55
Mary 85
Willian 93
Stone 75
Bella 85
It has 2 columns with students name on the first column and their score on the second column. How can I order it by the score from the highest to the lowest? If they have the same score, I would like to order by the name.
I'll display it in a table using cfloop. Does anyone know how can I do that?
Thanks

How can I merge rows in Excel 2010?

My Excel sheet contains columns for id, date, amount and name.
If two or more rows have the same id and name I want to merge them into one row with the amount of those two combined. Can anybody help me doing this?
Use concatenation with Columns ID and NAME (=ID&NAME) in another column and look for the pivot table. Move to Insert->Pivot table option to get the attached answer]
Hope this clarifies
Here is a possible solution (as far as I understand the problem) using a PivotTable:
As you can see, there is not really much to it. Just insert a pivot table and drag the ID & Name to the Rows while you move the dates and the values to the Values section of the pivot table. The Values in the Column section will be automatically generated.
The only thing I changed at the end was to format the pivot table nicely doing the following:
Remove SubTotals by name
Using a PivotTable style that I like from the PivotTable menu in the section Design.
Show items in a tabular format. That means that the name and the ID are shown on one row and not in a cascading format (ID in one row and the name in a second row underneath + indented). You can achieve this by right-clicking on the name and selecting Field Settings. A new window opens (showing the settings). Go here to the Layout & Print tab and select Show item labels in a tabular form. You might have to repeat that for the field Name and the field ID (depending on which of the two fields you chose to show first in the Rows section of the PivotTable).
Let me know if this solved your problem or if you have any questions.
Note: since no sample data has been provided I made some up. I sure hope this data is somewhat similar to what you are trying to aggregate.
Used sample data:
ID Date Amount Name
1 05.03.2015 121 Peter
2 14.01.2015 127 Max
3 11.01.2015 77 Eva
4 06.11.2015 141 Jamie
5 04.03.2015 58 Sophie
1 04.04.2015 94 Peter
7 20.06.2015 52 Lucas
3 14.12.2015 136 Eva
2 02.11.2015 93 Max
10 20.08.2015 59 Mason
4 11.01.2015 145 Jamie
4 02.02.2015 113 Jamie
4 26.02.2016 89 Jamie
1 30.03.2016 137 Peter
15 09.09.2015 81 Jackson
16 25.02.2015 61 Liam
2 26.02.2016 133 Max
2 26.10.2015 80 Max
19 25.09.2015 76 Aiden

Tableau - lookup letter grade from range

I have two Excel spreadsheets. One contains average numerical grade for a student and the other a list of letter grades for numeric grades between a min and max
Spreadsheet 1
Student Avg Letter Grade
Mike 91
Joe 76
Mary 84
Sally 78
Spreadsheet 2
Min Max LetterGrade
90 100 A
81 89 B
71 80 C
61 70 D
0 60 F
How do I return the proper grade for each student in Tableau? It seems trivial but I can't figure out the calculation. Thank you for your help!!!
There is an easier way to do this by using Groups.
Import Spreadsheet 1 as a data source
Right Click on "Avg" and select Create Group
From there use Shift Click to group your ranges using Spreadsheet 2 as your reference, using labels "A, B, C"
On the top of the Create Group dialog box, make sure you rename your Field Name as "Letter Grade"
The weakness of this approach is that you have to check/redefine your groups if you are updating your data source. Using IF-ELSEIF statements may be more flexible as Inox suggested in the comments. But this is a relatively easy trick, without any programming involved. :-)
For more info, visit: http://kb.tableau.com/articles/knowledgebase/use-ad-hoc-groups-categorize
Hope this helps!

Excel: Combine Multiple Rows and Adding Similar Columns

Hopefully this is an easy question: I need to combine some similar rows in a spreadsheet but I need to add the values in one of the columns. For example, the data looks like this:
Result Count ID
100 75 xxx
100 10 xxx
100 5 xxx
95 35 yyy
95 40 yyy
95 10 yyy
I would like to combine all rows so that there is just one row for ID xxx and one row for yyy so that the final spreadsheet would look like:
Result Count ID
100 114 xxx
95 75 yyy
I know that I could probably use sum but I'm dealing with several thousand rows of data and was wondering if there is a way to do this more quickly.
Your example does not make sense, the numbers don't add up. Can you also have something like:
Result Count ID
100 114 xxx
95 75 xxx
80 70 yyy
I guess you could get very far with pivot tables. There are many other ways but pivot tables are more visual and easily customisable.
Select your data, go to the Data menu and click on Pivot table. The pivot table builder will pop up. Drag the ID column into the Row Labels list, drag the Count into the Values list and Result into the Row labels list again.
You can actually slice and dice your dataset any way you want with the pivot tables. To learn more just pop-up the help(F1) for pivot tables and follow some examples.

Resources