Average using excel formulas - excel

hope it's been a good holiday.
Had a question regarding excel, that can best be phrased through an example.
I have a table which has 4 columns and 2 rows. in the each of the 4 inputs in row 1, we have a $ amount our company has (100000, 150000, 200000, 175000), and in row 2 we have the amount of product which we've been able to purchase, note: this products doesn't have a fixed price, and is constantly changing. Row 2 has the values (10000,20000,22000, 18000 respectively for the above $ amounts).
I want to have a cell, where if I input the dollar amount, I have, it will give me the average amount of product I can buy based on the historical data. Also, I need the formula to be dynamic, i.e once I add a fifth column, it takes the average using 5 datapoints, instead of the previous 4.
Thanks for any help, was having problems uploading an excel to display this, so hope this suffices.
I tried various look up/index formulas with no luck.

You want FORECAST.LINEAR():
=FORECAST.LINEAR(C6,2:2,1:1)

Related

generate all possibilities from two fixed rows of entries?

I spent hours trying to look for a solution and I feel like I got close but figured asking would be the best way.
Lets say I have a table with 2 columns, column A is an item, and column B is a price for the item. This table has 12 entries. What I would like to do is generate additional tables of 6 entries that do not exceed a certain price. see below for example. The number i want these table to not exceed is 50,000.
for example the first entry could be an apple at 9,000 value. the apple is column a, and value column b.
Can someone help with a way to generate all combinations of 6 items from column a, that do not exceed a combined price of 50,000 in column b?
With 12 items you have 212-1 or 4095 possible combinations of products. These can map into the 12 bits of a 12-bit binary number. It is not difficult to write a macro to calculate the total cost of each combination and then filter the result to display results less than or equal to 50,000.
EDIT#1:
Please see:
Best possible combination sum of predefined numbers that smaller or equal NN
Listing all possible combination without repetition,VBA

How to calculate no of days where sales were made in MS excel using sumifs and countifs?

I am working on an excel sheet where I am required to calculate average number of days the stores in a city were able to make some sales. I am attaching a sample of the table for reference. The values in the cells represent the number of units sold(not relevant to this question).
Here across NY, two stores are present, and out of the total number of days in consideration (3*2), only 4 days some sales were made, making the average 66%.
Similarly for Paris, there exists only one store which was open across all days.
To arrive at the figures, I tried using nested countifs and SUMIFS , but did not receive the expected results. Also, in some of the older posts, users had suggested to use INDEX MATCH with SUMIFS, but I was not to get accurate results using these.
Can anyone help me to get the correct figures for Total days, and Days with some sale.
SUMPRODUCT SOLUTION
=SUMPRODUCT(--(A$2:A$5=A8)*--(C$2:E$5<>""))
=SUMPRODUCT(--(A$2:A$5=A8)*--(C$2:E$5<>"NO SALE"))
=ROUND(C8/B8,4)
First, according to your grid NY made sales on 4 of the 6 days. (NY1: Mon, Wed; NY2: Tues, Wed). Thus the average is not 50% but 66%.
Second, to get your formula. Assuming "Place" is in column A. Below is for NY, you can solve for the rest.
Total number of days:
In cell "C9": =COUNTIF(A2:A4,"=NY") * 3
Days with sales:
In cell "D9": =COUNTIF(C2:E2,"<>NO SALE") + COUNTIF(C4:E4,"<>NO SALE")

Working with Combinations/Probability in Excel

Working an a project with many more possible combinations and I'm not sure how to approach it, so I'm going to ask how to do it on a smaller scale and then apply it to a larger scale.
I have to buy 1 of product A and 1 of product B
They both come in 100 varieties at different prices.
For product A:
TABLE 1 (A1:B6)
Dollars-Versions
1-15
2-20
3-30
4-20
5-15
and Product B
TABLE 2 (C1:D6)
Dollars-Versions
1-40
2-30
3-20
4-5
5-5
I know the minimum I can spend is $2 (600 combinations) & the Max is $10 (75 combinations), and there are 10000 (100x100) total combinations
If I put the dollar values 2-10 in cells E2:E10, is there a formula to quickly determine the number of combinations for each net dollar value in cells F2:f10?
I imagine it would have to be done with an sumif array formula, but I can't start to figure out what it would be. If I had a small data set like this, I would make a crosstab, but my data set is too large to do it efficiently.
Thank you in advance!
You would need a formula like this:-
=SUM((A$2:A$6+TRANSPOSE(C$2:C$6)=F2)*B$2:B$6*TRANSPOSE(D$2:D$6))
which would have to be entered as an array formula using CtrlShiftEnter
It builds up a 2D array with ones at the elements where the corresponding cells in the two lists add up to the amount you have to spend, then multiplies it by the corresponding numbers of combinations.

I'm trying to calculate the average with multiple columns (days and firms) and rows

I'm currently trying to calculate the following:
That is, the average daily sales of a firm. The example underneath is small, but in reality I have 280 days and over a 100 firms. I've tried with VLOOKUP(firmname A, (cells), sales) but it obviously only brings back one number. Sum(Vlookup) is also not the best of choice.
Anyone who could point me in the right direction ... SUMIF?
http://i66.tinypic.com/2wmnrbn.png
Assuming data is located at B2:C11 and the list of Firms is at F2:F5 enter this formula in G3 and copy till last record
=AVERAGEIFS($D$3:$D$11,$C$3:$C$11,$F3)

AverageIf and Multiple data strings

I'm involved with a youth football tournament on the referee side, with assessing/coaching the referees. I've just taken over doing the data entry for the referees assessment scores which we then use to determine who gets finals etc and am looking to extract more usable information from the data to help us identify trends.
I've got (up to) 200 referees, each receiving from none to two assessment scores each day for 5 days. The scores are entered as both the raw mark and the weighted mark based on match difficulty (along with a host of other data about the match that isn't relevant to this issue.
I can extract the average mark (raw and weighted) across all referees without issues and have done so using the below formula, which is the raw average mark:
=AVERAGE(Working!AK4:AK200,Working!BK4:BK200,Working!CL4:CL200,Working!DL4:DL200,Working!EM4:EM200,Working!FM4:FM200,Working!GN4:GN200,Working!HN4:HN200,Working!IO4:IO200,Working!JO4:JO200)
But I also want to extract the average mark (raw and weighted) across two subsets - Academy and non academy referees, to help plot trends and determine where resources need to be utilised.
I've attempted to use an AVERAGEIF formula, but am getting a #VALUE! return. This is the formula that I've attempted to use to return the average raw mark for those referees in the academy:
=AVERAGEIF(Working!G4:G200,Working!G4:G200="Yes",(Working!AK4:AK200,Working!BK4:BK200,Working!CL4:CL200,Working!DL4:DL200,Working!EM4:EM200,Working!FM4:FM200,Working!GN4:GN200,Working!HN4:HN200,Working!IO4:IO200,Working!JO4:JO200))
If I do the same formula as above, but without the brackets around the [average_range], I get a 'you've used too many arguments, and it highlights BK200.
From what I've been able to find so far online, it seems that the formula I'm trying to use would only work if ALL the cells in (Working!G4:G200) returned "Yes". However if there are only 50 academy referees as indicated by "Yes" in G column, then I want those specific scores to be averaged, and the inverse for the non-academy referees.
I thought about having another sheet, which would simply contain populate from Column G (a simple =G4 and then populated down to =G200 next to all of the scores), consolidated into a block of raw marks columned under Assessment 1, 2, 3, 4.... and then the same for all of the weighted marks which would populate from the equivalent cell on the working sheet, but there's a lot of filtering, and re-sorting that goes on on the working sheet, and I'm not 100% certain that that wouldn't cause issues.
Any feedback on how to work through this problem, so that I can display the overall average mark for academy and non-academy referees in both raw and weighted form would be much appreciated, and I apologize if this post is rather convoluted.
I don't think there is a neat solution if the scores are in several columns which are not consecutive.
My suggestion is:-
(1) Work out the sum for each column separately and total them up
(2) Work out the count for each column separately and total them up
(3) Divide Sum by Count to get Average.
In my small example below with 3 referees and 3 columns:-
(1) In K2:-
=SUMIF(H2:H4,"Yes",B2:B4)+SUMIF(H2:H4,"Yes",D2:D4)+SUMIF(H2:H4,"Yes",F2:F4)
(2) In K3:-
=COUNTIFS(B2:B4,">=0",H2:H4,"Yes")+COUNTIFS(D2:D4,">=0",H2:H4,"Yes")+COUNTIFS(F2:F4,">=0",H2:H4,"Yes")
(3) In K4:
=K2/K3
This would include any zero scores (if this is possible) but exclude any blanks.
You can then scale it up to your data.
Beyond this, you would have to change the data structure either
(1) Add a row to label the columns that you want to average e.g.
Score 1 Score 2 Score 3
3 0 3
so you could pick up only the columns labelled 3 say
Here's how it would be in my small example:-
In K3:-
=SUM((B$2:F$2=3)*($H3:$H5="Yes")*B3:F5)
Which is an array formula and must be entered with Ctrl-Shift-Enter
In K4:-
=SUM((B$2:F$2=3)*($H3:$H5="Yes")*(B3:F5<>""))
another array formula
In K5:-
=K3/K4
This is how the columns you want are labelled with a 3 in row 2, so it ignores the other columns:-
(2) Consolidate them into another sheet as you suggest.

Resources