I have my Excel formula found below does this:
Scenario:
I have three products, product A, product B and product C. I want to be able quickly to calculate the actual revenue. The data structure is in the image. My top-most row is month. For each month I have four columns, of which two need to be calculated should the condition match.
This is the condition. An example, for product A, calculate the total sumproduct (multiplies column actual customers x Price Actuals) for yearMonth 201501.
So basically, first, for product A, it would need to find YearMonth 201501, and when it is found, it should find columns Actual Customers and Price Actuals and return the SUMPRODUCT of Actual Customers and Price Actuals.
Modification help
I want the formula to divide at the end with the total amount of customers for that specific product and month. How can I do that?
Here is the workbook. Workbook
=SUMPRODUCT($B$3:$I$5*($B$1:$I$1=TheMonth)*(($B$2:$I$2="Actual Customers")+($B$2:$I$2="Price - Actuals"))*($A$3:$A$5=TheProduct))
If you need to get the amount of customers for that month and product, you can just modify that sumproduct function to get this:
=SUMPRODUCT($B$3:$I$5*($B$1:$I$1=TheMonth)*(($B$2:$I$2="Actual Customers")*($A$3:$A$5=TheProduct)))
That (for me) returned the value 56 for p C and 1951 for p b, so I'm pretty sure you would just have to do formula1/formula2 to get what you want (where formula1 is your original formula and formula2 is the one I posted here.
I am not sure I fully understood your question but as far as I got it, and following your file, for product A (pA) you would like to have the following:
D3*F3 = 1064?
Is that right?
If it is, I don't see the reason for using the sumproduct function. You could just add a new Actual Revenue column in between each month and compute it for each row.
If I am wrong in my understanding, please elaborate with an example of what you would like to do (please use the same simple computational description I showed above).
Related
I have a problem with an excel function, i "inherited" from a former colleague.
I have the two tables below:
My goal is to get the green field in Table 2 to show the sum of Person1s earnings from January to December. If months was =11 in Table 2, it should show the sum of Person1s earnings from January to November.
My current formular is a lot of nested "If" and "Sum.if" functions, but i wish to shorten it. Is it possible. I tried to say the sum area in the Sum.If to be all columns with data, but it still just returns the one from january (the first one it finds, i guess)
I hope someone can help me! Sorry for my bad english, but i'm not a native speaker
Best regards
Edit: Current formula by request
=IF(A2=0;0;IF($I$1=1;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L);IF($I$1=2;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M);IF($I$1=3;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N);IF($I$1=4;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O);IF($I$1=5;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P);IF($I$1=6;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q);IF($I$1=7;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R);IF($I$1=8;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S);IF($I$1=9;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T);IF($I$1=10;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T)+SUM.IF('Earnings'!A:A;A2;'Earnings'!U:U);IF($I$1=11;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T)+SUM.IF('Earnings'!A:A;A2;'Earnings'!U:U)+SUM.IF('Earnings'!A:A;A2;'Earnings'!V:V);IF($I$1=12;SUM.IF('Earnings'!A:A;A2;'Earnings'!L:L)+SUM.IF('Earnings'!A:A;A2;'Earnings'!M:M)+SUM.IF('Earnings'!A:A;A2;'Earnings'!N:N)+SUM.IF('Earnings'!A:A;A2;'Earnings'!O:O)+SUM.IF('Earnings'!A:A;A2;'Earnings'!P:P)+SUM.IF('Earnings'!A:A;A2;'Earnings'!Q:Q)+SUM.IF('Earnings'!A:A;A2;'Earnings'!R:R)+SUM.IF('Earnings'!A:A;A2;'Earnings'!S:S)+SUM.IF('Earnings'!A:A;A2;'Earnings'!T:T)+SUM.IF('Earnings'!A:A;A2;'Earnings'!U:U)+SUM.IF('Earnings'!A:A;A2;'Earnings'!V:V)+SUM.IF('Earnings'!A:A;A2;'Earnings'!W:W);"")))))))))))))
In B16, enter formula :
=SUM(OFFSET(B2,MATCH(A16,A3:A9,0),,,C12))
SUMIF is used to add the contents of a single column that match the criteria.
To achieve what you want, try this:
To shorten the formula significantly
=SUMPRODUCT(($A$3:$A$9=$A$14)*(B3:K9))
I have guessed your row and column numbers, but if you can't get it working just post your row and column headings and I will troubleshoot it.
Alternatively, if you would like to add another table with cumulative earnings, you could do it quite easily.
To provide cumulative earnings for each month for each person
For example, in B15 (or whatever the reference, we can't see your row/column number) you could have "Cumulative Jan", then fill right for a column for the cumulative earnings for each month. In that case B15 would say:
=SUM($B3:B3)
Then fill right and down.
This gives you cumulative earnings for any month for any person, in a table.
You could then do a lookup to that table if you wanted to, to return the matching value given the two inputs of person and month number.
I need to create a module that will count the amount of values in specified date ranges, with other criteria.
For example, I have a list of products (Products A, B , C, D) in column C, and their sale date in column G.
I need to count all of product A sold before 1/1/1998. I then need to calculate product A sold between 1/1/1998 and 1/1/2005 etc.
I need to be able to run this for all the types of products, and group products together.
E.g. count all of product A & B sold before 1/1/1998.
This has to be done for a new workbook on a weekly basis so ideally needs to be able to be run for a new workbook each week. The tab names always remain the same.
Any help on how to get started would be appreciated
This answer will assume that your dates are entered as excel dates in column G and not a text. You can test this by using the formula =ISNUMBER(G3) where G3 is one of your dates. If it returns true, then your date is properly stored for use by excel formulas and this answer.
=SUMPRODUCT((($C$1:$C$100="A")+($C$1:$C$100="B"))*($G$1:$G$100<Date(1998,1,1))
That is how to hard code it. Personally I would build a table. Each row of the table would be a product you are interested in knowing the count for and a sum of the count would give you combined totals. Repeat the table if you need multiple combinations.
In the following example a single product was counted and then the total for all products listed was the total. The formula for the example in L3 and copied down for each product was:
=SUMPRODUCT(($C$2:$C$9=$J4)*($G$2:$G$9<K4))
The total at the bottom of the table was a simple SUM formula. Because SUMPRODUCT performs array like operations, avoid using full column references and try to restrict it to the data that needs to be checked. Otherwise you may notice a slow down in your system as multiple excess calculations are being perfomed.
I am certain that there is an easy way to do this, but for some reason this one is sitting in my blind spot...
I have a price catalogue that lists all possible part numbers, and their prices. I have a separate stock list that has been produced by a third party which lists all of the parts that they hold in stock. I need to write a formula that checks if the parts on the stock list are in the price catalogue, and if they are, add the price to the stock list.
For example, if the price catalogue has part number in column A and price in Column B, and I add the part numbers from the stock check to column C, I need to check if they are in A, and if they are, add the price into column D.
Does that make sense?
Thanks!
VLOOKUP is one formula which can help you resolve your problem.
A combination of INDEX-MATCH-MATCH is another formula which can get you the same result.
VLOOKUP is a VOLATILE function and takes longer time to work. However, this can be experienced only in large files.
Some experts have compared the working results of both these and have concluded that VLOOKUP is about 13 times slower than the INDEX-MATCH-MATCH formula combination.
I needed some help with Excel functions as I am not really sure how to achieve this.
Basically, this picture shows my data structure:
I am aware that I can use Index& Match excel functions together for columns but I am not sure if it is possible use Index&Match together on two row conditions.
Requirement:
I have three products, product A, product B and Product C. I want to be able to quickly calculate the actual revenue and and you can see the data structure in the image above. My top-most row is month. For each month, I have 4 columns, of which 2 need to be calculated should the condition match.
This is the condition. An example, for product A, calculate the total sumproduct(multiples column actual customers x Price Actuals) for yearMonth 201501.
So basically,first, for product A, it would need to find YearMonth 201501, and when it is found, it should find columns Actual Customers and Price Actuals and return the SUMPRODUCT of Actual Customers and Price Actuals.
Is it possible to do this?
I have searched the Internet a bit and I have not found a solution.
Update:I thought I could post the follow-up question in the same thread insted of Cristiano duplicates... For the accepted answer, in the excel formula, how can it be divided by the total amount of "actual customers" for that month?
Simply adding "actual customers" with a slash before IT does not work.
You need a cell where you specify the month you want to look up. Give that cell the name "TheMonth".
You need a cell where you specify the product you want to look up. Give that cell the name "TheProduct".
Then, assuming your screenshot starts in cell A1, you can use
=SUMPRODUCT($B$3:$I$5*($B$1:$I$1=TheMonth)*(($B$2:$I$2="Actual Customers")+($B$2:$I$2="Price - Actuals"))*($A$3:$A$5=TheProduct))
Next time, please post a link to a workbook. It's not much fun typing in the text and numbers from a screenshot in order to verify a formula.
Here is the workbook with the formula in action.
I am trying to create a budgeting spreadsheet, I nearly have it all working except one function.
Monthly Budget Sheet: http://i.imgur.com/uLJ1AfA.jpg
In this I am trying to read all data on my Transactions Sheet column B: http://i.imgur.com/0SaWEqa.jpg
if they match the Category I have in Monthly Budget B column, I grab the value from Monthly Budget column C and add them up in Transactions column D.
This is my current function: =sumif(Transactions!B:B,A4,Transactions!C:C)
Hopefully my pictures explain what I am talking about. My issue is I also want to filter it so it only adds the values of the ones for that month. E.g. the column 'Actual' in Monthly Budget should grab the value of Eating Out categories in Transactions ONLY IF they are in January, so the first 2 in the image but not the third.
So basically I need to add some way to modify =sumif(Transactions!B:B,A4,Transactions!C:C) so that it will only take entries between 01/01/2014 and 31/01/2014.
Thanks in advance!
use the Month() formula
i think it would be alot easier if you add another column(B) on the transaction sheet after date called month( hide it if you like)
=CONCATENATE(MONTH(A2),"-",YEAR(A2))
then use the SUMIFS function to add up based on 2 criteria
=SUMIFS(Transactions!D:D,Transactions!C:C, A4 ,Transactions!B:B, "1-2015")