I've got duplicate dates in my first column. I have corresponding ratings in the next columns. My goal is to combine the ratings into all one date only if they are duplicate dates. I have many duplicate dates and for each duplicate I simply want to combine the numbers:
DATE 5STAR 4STAR 3STAR 2STAR 1STAR
12/2/2009 0 1 0 0 0
12/2/2009 1 0 0 0 0
4/6/2011 1 0 0 0 0
4/6/2011 1 0 0 0 0
So in the example above I would want to be left with:
DATE 5STAR 4STAR 3STAR 2STAR 1STAR
12/2/2009 1 1 0 0 0
4/6/2011 2 0 0 0 0
Assuming that your original sheet is called "duplicate data" and that you have created a second sheet called "combined data" and which has exactly the same format but with only one row per date, but this formula in B2 of combined data and drag down and over as far as necessary:
=SUMPRODUCT(('duplicate data'!$A$2:$A$5='combined data'!$A2)*'duplicate data'!B$2:B$5)
In Excel 2007 and 2010 you can easily remove duplicate dates using Remove Duplicates in the Data tab. In XL 2003 I believe you'd use the Advanced Filter in the Filter item of the Data menu.
If you're going to be doing this more than once, I'd look at normalizing your data a bit so that you could do this with a pivot table. If I'm guessing correctly that only one column per row ever gets a one, i.e., there's only one rating per row, and your data looked like this...
DATE Rating
12/2/2009 4STAR
12/2/2009 5STAR
4/6/2011 5STAR
4/6/2011 5STAR
... you could easily create a pivot table from it.
Related
I need to count the number of rows in an excel spreadsheet that contains the number 1.
- A B C
1 0 0 1
2 0 0 0
3 0 1 0
It would look somewhat like this, except with around 1000 rows.
Any help is great!
To count any value attending to some criteria you can use COUNTIF(cells,criteria)
More details here: https://support.office.com/en-us/article/countif-function-e0de10c6-f885-4e71-abb4-1f464816df34
Hope it helps
I have a basic excel spreadsheet like this:
A B C D etc..
1 1 0 0 etc..
0 0 1 1 etc..
0 0 1 1 etc..
I would like to SUM 100 for every cell that contains 1 in one Cell and to SUM 100 por every cell that contains 0 in other cell.. How can i do this?
I hope you understand my question, english its not my first language.
It looks as if the answers might be
=COUNTIF(A1:D10,1)*100
and
=COUNTIF(A1:D10,0)*100
(change the ranges as necessary)
I have some data that looks like:
Day Result
1-Nov 1
0
1
2-Nov 1
3-Nov 0
0
4-Nov 1
There are other columns with data. I only have the date once as the data is displayed graphically in a time series.
Now I'd like to setup a summary table that aggregates each day. I cannot use sumifs because the date is only in the data once.
How could I write a calculation such that excel sees a2 has a value so sums b2,b3,...bi until ai has a value.
Preferably not vba, never learned it and want to do this in excel rather than R or Python.
EDIT:
I am specifically looking at how to do calculations on the result column grouped by each date. Blank cells should be considered the same date. So when excel sees 1-Nov it then does a calculation (i've said sum but any we can extend to) on 1,0,1 and then stops and a new calculation is done for Nov-2.
IMHO, instead of using a table like this:
Day Result
01/nov 1
0
1
02/nov 1
03/nov 0
0
04/nov 1
You should populate the "Day" column and use a pivot table to summarize the results.
I.e.:
Day Result
01/nov 1
01/nov 0
01/nov 1
02/nov 1
03/nov 0
03/nov 0
04/nov 1
And the pivot table:
I've been hitting a wall on this today. I'm pulling my data from a SQL DB and in my query I'm setting flags so that I can use the Pivot table to count up all the different checks I'm trying to run on the data. A simple version of what I'm doing would look like this is below with a Greater than 90 days and Error Check flags set depended on the data in Uptime.
Host Team Uptime >90 ErrChk
Srv1 A 15 0 0
Svr2 A 102 1 0
Srv3 B 95 1 0
Svr4 B 20 0 0
Srv5 B 21 0 0
Srv6 B ERROR 0 1
Srv7 A ERROR 0 1
Srv8 B 150 1 0
Srv9 A 100 1 0
Srv10 A 10 0 0
Srv11 A 125 1 0
Srv12 A 40 0 0
Srv13 B 111 1 0
Srv14 B 100 1 0
Srv15 A 15 0 0
If you were to plug this into Excel exactly the way that it is you will see what I'm getting at. Once you create a Pivot table on this data and use the Team as the Rows and the Sum of >90 and ErrChk the pivot comes out and looks correct.
Row Labels Sum of >90 Sum of ErrChk
A 3 1
B 4 1
Grand Total 7 2
But the next piece is where it gets wonky. With a Pivot table when you double click one of the values it filteres down on what makes that value, however when you do it on the value of a SUM, it just filteres down on the Row Label. So for this example you would click 3 under >90 for team A to see what the 3 servers are that have been up for longer thank 90 days. However when you do this it gives drills down to just a filter of team A showing you all of the servers, the good, the bad, the error.
My question is how can I drill down to just the items that make up that value? I've tried all I can think of, have the filed be NULL, 0, calculated fields.
I would suggest adding an additional pivot table for the view you want. For your example you might want to add Team, then Host to Row Labels. Then add Sum of > 90 to Values. Then add > 90 to Report Filter and set the filter to 1.
These pivot tables could all be on the one worksheet pulling from the same data source as a kind of summary and the filter would be preset so there would be no need to provide instructions to those viewing the summary.
If you'd like let users change the filter easily you could add a slicer which will present all options by which the data can be filtered by.
id a b c
1 0 0 0
1 0 0 0
2 0 0 0
2 0 0 0
3 1 2 3
3 0 0 1
Given the above matrix, I want to create a new matrix, which sums the numbers within the first matrix for a given id in a given year (a,b or c). So for the above, it should look like:
1 2 3
a 0 0 1
b 0 0 2
c 0 0 4
Can anyone see what to do?
Try using SUMPRODUCT rather than SUMIFS, e.g.
=SUMPRODUCT(B2:D7,(B1:D1="a")*(A2:A7=1))
The formula solution given in the other responses will work well when data headings are already in place and the data range is not too large.
A pivot table creates the row and column headings for you and will update as new data is added when you click the Refresh Button, it's also significantly quicker when the data range is large.
Steps
A) Choose Insert | Table for your data range, and give it a suitable name, the default is Table1
B) Access the PivotTable wizard via the shortcut Alt+D+P (this is not on the default menus).
1) Multiple Consolidation Ranges
2a) I will Create the Page Fields
2b) Range: Table1[#All] Page Fields: 0
2c) Existing Worksheet: $A$7
C) Click Finish, switch Row and column fields and turn off totals and autoformatting
I suggest that you try solving that problem with pivot tables.
Here are 2 links that you might use to learn that feature:
http://www.cpearson.com/excel/pivots.htm
http://www.youtube.com/watch?v=7zHLnUCtfUk
The only drawback with Pivots is that if the size of the source range changes, the Pivot will not adjust automatically. So once you managed to solve your initial problem and understand the power of Pivot Tables, I suggest that you use a Dynamic Named Range as the source of your Pivot.
Edit:
I feel that barry houdini's solution is simpler. I reproduced it below (with all credit belonging to him!)