I am using a spreadsheet to count sold items for several teams.
Rows: Individual Seller
In column A I have the specific team the seller belongs to.
In column B I have the amount of items that the seller sold.
In a separate row at the end of the document, I am trying to calculate the total number of items being sold from a specific group.
Can anyone help me write the code needed to return the total number of items sold for each specific team?
The image shows some sample data in A1:C13, and three different ways to sum the amounts by teams. There are many others ways. Of the three I recommend #Jerry’s suggestion of a PivotTable (E2:F6) because it is very easy to set up, very quick in operation and offers a great deal of versatility beyond merely summing amounts by team. For example if your data included dates of sales it could sort and group by week, month, year etc. The second version of it (E8:F14) shows a breakdown by Seller of the 20 total, but by the number of ‘sales’ (rows) rather than number of items sold.
The formula in D20 (copied down to D22) is:
=SUMIFS(B$2:B$19,A$2:A$19,A20)
However SUMIFS was not available as a standard MS Office function before Excel 2007, though SUMIF was, so in B20, also copied down to suit:
=SUMIF(A$2:A$19,A20,B$2:B$19)
SUMIFS allows more conditions than SUMIF, so for example can be changed in D20 to:
=SUMIFS(B$2:B$19,A$2:A$19,A20,C$2:C$19,"Seller1")
to obtain the amount of items comprising the two distinct ‘sales’ by Seller1 as shown by 2 in the lower PivotTable.
Since you are trying to calculate the total from a specific group the above may be more elaborate than your immediate requirement so a version that can be placed almost anywhere in your sheet (if as the example) and even copied around, replaces a variable with a fixed condition, which I have chosen to be teamB:
=SUMIF($A$2:$A$19,"teamB",$B$2:B$19)
and provided the formula is kept out of ColumnA might be further simplified by extending it to consider entire columns:
=SUMIF(A:A,"teamB",B:B)
Related
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.
Basically I envisage having a table of risks in Excel for various projects. Each risk has a score and its project name on one row of the table (amongst various other pieces of information).
What I would like is a formula, repeated in 3 cells with minor adjustments, to return the 1st, 2nd and 3rd highest scored risks for a given project. The project would ideally be selected by a reference in the formula to another cell with a dropdown list of all the projects so you could select the project in the drop down and see the corresponding highest risks.
I have tried using =Large([table array],[1/2/3]), =vlookup and =offset - but this just returns the highest three scores in the whole table - I can't figure out how to make the formula look at only the set of rows pertaining to a given project.
Many thanks for any help or advice offered!
I have a table for capacity management, that contains information about teams working on project in time. I would like to be able to create a new table, that would basically tell me, which team is overloaded. I guess example would explain it better:
Here is simplified table 1
The number indicates how many resources is needed from the team on given day
Here is the second table, that I need
The numbers in columns is sum of all numbers for the team for the specific day across all projects.
Is this somehow possible? Thanks for any advice!
Create a summary table with the dates in the column headers and the team names in the row headers. Then you can use a SumProduct() formula to calculate the totals per team and date. Refer to the screenshot below.
The formula in cell B13 is
=SUMPRODUCT(($B$1:$H$1=B$12)*($A$2:$A$8=$A13)*$B$2:$H$8)
Copy across and down. The summary table can be on a different sheet. Just make sure that you get the references right and pay attention to the placements of the $ signs.
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.
Is this possible? I have 2 spread sheets, one with a list of items, and how many items are being requested. I have another spread sheet with the same list of items, when inventory will arrive, and how many units. I need to know at what point do we NOT have enough inventory to cover the requested amount.
I know how to do the formulas on an individual basis but do not know how to combine them. I need a formula that will look up the items, then reference a table where the column headers are the week numbers, and quantities are listed for each item. It would then do a subtraction of the requested amount, from the inventory through the specified week numbers, and populate with the corresponding week number of when the inventory for that item became negative.
I have my items listed, in one spread sheet. I need to know at what week as listed in the next spread sheet does inventory become negative, so i can say when the orders is at risk.
Any Help on this would be immensely appreciated. Even just help with breaking down the logic would be great. Thank you.
Use pivot table and Messages alert (using formulas) that alert you anytime "Product Requested" is less then "Available Product". Data Validation is what you need to search for in Excel.