How to autosort a column in Excel when editing a table - excel

I have want to make a sports system so that people can bet each weeks on a few games. So:
Name | week 1 | week2 | ... | week 32 | Total
I want every time when I insert some value in the week columns that total table gets sorted.
Can somebody help me with this?

Related

Formula for Data Comparison

I am looking for a formula that will populate a cell based on yesterday's day value for last month.
Please see my example:
Prior Month Comparison | | |
5-Jul | 5-Aug |4-Aug | 5-Jul
Total Number of Records: 10 | 25 | 7 | 10
Total Records Sold: 5 | 3 | 0 |... 5
I have all of July records to the right of my August records. I might have to use arrays so I'm not sure what would be the best approach.
I have looked into index/match but I'm not sure how to best apply this formula. I am available to any formula that will help me fill out my Prior Month Comparison column.
Thanks!!
Use HLOOKUP:
=HLOOKUP($B$1,C:E,ROW(),FALSE)

Excel - Rather complex SUM IF criteria

I have roughly the following setup:
Values:
MONTH | DURATION | VALUE |
5 | 3 | 120 |
6 | 1 | 100 |
Expected outcome for totals:
MONTH | TOTAL
5 | 120
6 | 220
7 | 120
What I would like to do, is to be able to sum in another table the total values for each month. The logic would be to SUM every value where the total table's month is equal or higher than that of the values, but lower than the value's month + duration.
Does that make any sense? Is that possible? I'm cracking my head and I can't seem to find a way to solve it.
Thank you very much.
The easiest solution is probably to make another column with the end month. And then use SUMIFS to check if month is >= starting month and <= ending month.
=SUMIFS(<Range of Values>,<Range of starting>,"<="& "Target month",<Range of ending>,">="& <Target month>)
DSUM is the best candidate for this, I believe. See Microsft's documentation and this site for help understanding function, and what it is doing. I have made very complex calculations possible in Excel by using the "database" methods (DSUM, DCOUNT, etc).

Add entire calender year to pivotTable in Excel from sample with only few dated entries

Hopefully somebody can help me figure out a better way to create what I need in a pivotTable. I have a table structured as follows:
Date | ID# | Revenue
---------------------------------------
1/1/14 | 123 | $200.00
1/1/14 | 234 | $99.00
1/5/14 | 455 | $100.00
1/31/14 | 5666 | $50.00
2/4/14 | 2454 | $500.00
...
...
...
12/4/14 | 88484 | $3000.00
Unfortunately, when I create a pivotTable off of this information, and then try to process the data all the way into chart data, it gives me only dated entries when there is an actual entry.
What I need is to not only create a table that shows dates that had $0.00 revenue, but also a chart that displays all 365 days, without manually going back day by day (as there are 1000+ rows) to enter a day that has a $0.00 revenue.
Any ideas?
One approach would be to put the days of the year into a spare column, say D, by starting with 1/1/14 in D2, pulling down with the right mouse button and choosing 'Fill Days'.
Then put a formula into column E starting in E2 like
=SUMIF(A:A,D2,C:C)
to put in the total revenue for each day in column C based on all matching days in column A.
that's assuming that what you want is the total revenue for each day of the year whether or not it's zero.

PowerPivot transpose column headers on rows

I have two datasources, one comes from an excel file i cannot change with this format
item | week 1 | week 2 | ...
ITM01| 12 | 23 | ...
My second datasource comes from a query and looks like
item | Week | Value
ITM01| 1 | 5
ITM02| 2 | 10
...
I need to merge the two tables to have, hopefully, something like
item | Week | Value 1 | Value 2
ITM01| 1 | 5 | 12
ITM01| 2 | 10 | 23
...
I'd like to achieve this in powerpivot, considering that I cannot change the excel datasource, and i would like it to be updateable by using excels refresh button, which means, i think, that i should not create custom tables to handle the transposition, as that might ruin the refresh.
I'm really lost on how to achieve this and some help would be much appreciated.
I'd also add that i can change the second data source to look like the first one(weeks on columns), but while i might be able to connect the two tables, i would still not know how to achieve the desired output with weeks on rows.
Thanks a lot for your time.

Custom Formula for Grand Total column

I have a frequent problem where the formula I want to use in the Values area in my Pivot-Table is different than the formula I want to use for the Grand Total column of that row. I typically want to Sum the Values but I want to average the Sums. Here is what I normally would get if I pivoted the dates on the Column Labels, Meat Type on the Row Labels, and Sum Orders in the Values.
Row Lables | Day 1 | Day 2 | Day 3 | Grand Total
________________________________________________
Beef | 100 | 105 | 102 | 307
Chicken | 200 | 201 | 202 | 603
I get sums by day and a sum of all of the days in the Grand Total column. Here is what I want to have:
Row Lables | Day 1 | Day 2 | Day 3 | Grand Total (Avg of Day Totals)
________________________________________________
Beef | 100 | 105 | 102 | 102.3
Chicken | 200 | 201 | 202 | 201.0
In this case the Orders are still summed by day but the Grand Total is now an average of the sums. What I do now is copy and paste the Pivot data onto a seperate sheet then calculate the averages. If there was a way to do this with a custom Grand Total column it would be incredible. This is one of the biggest shortcomings of Pivot Tables for me but I'm hoping it is due to my ignorance, which it often is. Thanks for the help!
You can write a measure that checks the number of 'rows' in a particular filter context and nest that in an IF() to determine which to use.
If using PowerPivot V2 then it's:
=IF(HASONEVALUE(Calendar[Day]), SUM(AMOUNT), AVERAGE(AMOUNT))
If using PowerPivot V1 it's:
=IF(COUNTROWS(Calendar[Day])=1, SUM(AMOUNT), AVERAGE(AMOUNT))
Both do the same thing in that they assess the number of rows in the table in the given context and when the Meat Type is 'Beef' then the temporarily filtered table has one row. If it doesn't have one row then its going down the path of the AVERAGE()
This assumes your column headers 'Days' are in a table called Calendar (if you aren't using a separate Calendar table then you are missing the most powerful functionality of PowerPivot IMO).
Jacob
I can't think of a "good" way, but here's one option. Add the Amount field to the data area a second time and change the operation to Average. Then use conditional formatting to hide the averages in the data area and hide the sums in the total area.
You might be better off just using some array formulas in a do-it-yourelf pivot table. You lose the pivot table benefits, but get more flexibility with the data.

Resources