Calculating the average percentage of a bunch of figures in Excel? - vba

Basically, I'm trying to calculate the total average outage hours of a worksheet I'm working with, however I'm trying to have it further broken down.
Here is a picture of the Excel Sheet:
Excel Calculations
(Not allowed to add embedded pictures yet :( - 10 reputation needed, sorry!)
Pretty much, I'm trying to calculate what the average up-time is for the month, by calculating the average downtime and then subtracting it from 100.00%
What I've got works, but I'm trying to workout whether the Outage Hours column can be scrapped, and the total can be calculated with perhaps just a larger formula.
Here is a link to the spreadsheet: https://www.dropbox.com/s/msowjndootd2hh2/Spreadsheet%20Calculations.xlsx?dl=0
Thanks in advance!

Just to clarify, you're looking for the result from the second column without having to include the second column, correct?
Since the second column is just the remaining difference (from 1.00) of the first column, then to get the result, all you have to do is take the remaining difference for the maximum overall to the total sum of the first column.
Meaning (assuming 12 months)...:
=12-SUM(B4:B15)
(Substitute 12 for however many months to be summed)
EDIT: OP is looking for =AVERAGE(B4:B15)

Related

Need to divide a Dataframe in various tables using multiple categories and date time

this is my first time asking a question here, so if I'm doing something wrong please guide me to the right place. I have a big and clean dataset. (29000+ , 24). The thing is that I have to calculate the churn rate based on 4 different categorical columns, and I'm given just 1 column that contains the subs for a given period. I have a date column too. My idea on calculating the churn is to do
churn_rate= (Sub_start_period-Sub_end_period)/Sub_start_period*100
The Problem
I don't know how to group the data using these 4 different categorical variables. Also If I manage to do so I would end up with more than 200 different tables, so I don't believe this would be a good approach.
My goal is able to predict the churn rate using the information in the table but I should be able to determine the churn rate based on these variables. The churn is not given, it has to be calculated, so I'm having problems here as I can't think of a way of working through this.

SQL Method for Cascading Workload Based on Rank and Available Hours

Recently I created an automated production scheduling tool through Excel that assigns a rank to items being produced in the same process, and then uses that rank in combination with the workload to create a schedule.
It functions exactly the way it is intended to, but due to the large amount of data and it being excel it has very slow performance, which is why I am looking to move the calculations over to SQL.
The general logic is like this:
-Always produce everything from the first day before the second day
-Always produce items from an earlier rank before items from a later rank
You can see how this plays out in the image below, where the line has 21.5 hours today, so items will be produced on day 1 until it equals 21.5, where the remainder is then carried over to day 2 and so on.
I was able to do this in excel using lengthy positional based formulas, but I am trying to think of a way to get the same result in SQL without having to rely on looking at the row above.
I am not sure how to convey something like 'Subtract from the available time production time of higher priority items produced on the same day'.
I apologize if the question is unclear, but any advice would be appreciated.
Image of Production Hours Cascading by Priority and Day
Example of Position-Based Fomula
Thanks to shawnt00, that put me in the right direction. Ultimately I had to modify the case statements a bit to go off of the cumulative total instead, but I was able to get the desired results using a sum() Over (partition by order by ) statement.

How to get last measure even empty, depending dimensions, with SSAS

I can't find a way to get a "snapshot" of data through a cube.
I have an inventory saved by date.
It looks like this:
My measure that shows inventory is called "Stock" and aggregation mode is "LastNonEmpty"
When I filter on a date, I always get the same result.
I understand why. But I can't find a formula for calculation measure and I'm not at ease with MDX queries.
Moreover, I correctly get a total of 8 on Week 39, but if I filter on the specific size "40", I will get a total of 1. This one is correctly excluded in total!
My aim is to have a snapshot of inventory that shows the last value including empty value and depending on other filters.
When I pick "Week 35" I want to have inventory on week 35. On week 38 I want to get an only value that exists. If I pick weeks from 35 to 38, I want the results of last week.
"week" is a hierarchy, there is detail until day under this hierarchy
Thanks for your help.
Take a look at Last Ever Non empty by Chris Webb.

DAX sum different DateTime

I have a problem here, i would like to sum the work time from my employee based on the data (time2 - time 1) daily and here is my query:
Effective Minute Work Time = 24. * 60 * (LASTNONBLANK(time2,0) -FIRSTNONBLANK(time1,0))
It works daily, but if i drill up to weekly / monthly data it show the wrong sum as it shown below :
What i want is summary of minute between daily different times (time2-time1)
Thanks for your help :)
You have several approaches you can take: the hard way or the easier way :). The harder (at least for me :)) is to use DAX to do this. You would:
1) create a date table,
2) Use the DAX calculate function to evaluate your last non-blank and first non-blank values (you might need to use calculate table, but I'm not sure; DAX experts jump in). Then subtract one vs. the other.
This will give you correct values for a given day for a given person. You can enforce the latter condition by putting a 'has one value' guard on the person name so that your measure informs the report author if they're not using it right.
Doing the same for dates is a little trickier. In the example you show you are including the date in the row grouping. But if you change your mind and want instead to have 'total hours worked by person' or 'total hours worked by everyone' you're not done with modelling yet.
Your next step is to use calculate table in combination with calculate to create a measure that returns the total. You'll use calculate table so you evaluate each date and the hours worked on that date by person. Then you'll use calculate to summarize that all down to a single number. If you're not careful with your DAX (or report authoring) you might mix which person you're summarizing for so that your first/last non blank are not at the person level. It gets intense quickly.
Your easier solution, though it might be more limited in its application - depends really on your scenario - is to use the query to transform the data into a summary by day and person using the group by command. This will give you a row per person per day with their start and end times. Then you can quickly calculate the hours worked on that day. Then you can quite easily build visuals on top of the summary data. Of course you give up some of the flexibility of the having a proper data model. However if you have a date table, a person table, and your summary table and then setup your relationships correctly you can achieve answers to the most common questions.

Tableau - Adding dimensions together to show overall revenue

I am very new to Tableau (first day user) and have been a long time Excel user. I am trying to fully understand the power of Tableau to eventually move away from Excel.
I have a question concerning dimensions and creating a calculated field.
My table has multiple categories and sub-categories. My goal is to display the total revenue and average order value per chosen sub-category (this seems easy enough).
I want to then take those sub-categories and show a combined sum of revenue and average of the average order value. I am stuck on trying to also combine these sub-categories to show a blended view.
Furthermore, the 2 sub-categories are weighted very differently. The average order value of 1 has a much heavier weight than the other and will definitely affect the AOV when combined. How do you also assign a weight to this combined total?
Any help will be much appreciated. I know this may be a rather simple solution but I am new to the program and am having difficulty finding this answer.
Tableau screen:
or
img1 http://postimg.org/image/dq5wqgnyl/
Best,
CR
Put sub categories in the rows column.
Put sum revenue in the text pill in the marks section
In the analysis tab on the top select column grand totals.
I'm unable to see your images,i hope this answers a apart of your question.