SUMPRODUCT on all sheets with sheet multiplier - excel

I have multiple sheets that have the same layout but have different products and quantities on each sheet.
Then I have a different sheet that I'm using to total all the other sheets quantities per product I'm using this formula
=SUMPRODUCT(SUMIF(INDIRECT("'"&D$8:D$10&"'!B3:B6"),B3,INDIRECT("'"&D$8:D$10&"'!A3:A6"))) Which works fine.
How can I sum all the product quantities from the same sheet more than once, For example if I add the number of times I want to multiply the sheet In column E next to each sheet name and I put a qty of 2 in E8 it would then double the quantity for that sheet well still summing all the other sheets.

You can use Named Ranges for this. Give the Cell "E8" a name - "Takeoff1_Multiplier" and in the Sheet Takeoff1, go to cell "A3" and in the formula bar enter
the formula =1*Takeoff1_Multiplier.
Now, when you change the value in "E8", the value in "A3" will be multiplied.
If you don't want to use a formula in the Column A in the Takeoff1 sheet, use the formula in column c as =A3*Takeoff1_Multiplier and drag this formula for all the rows.
Resources:
Named Range: https://support.office.com/en-us/article/define-and-use-names-in-formulas-4d0f13ac-53b7-422e-afd2-abd7ff379c64

=SUMPRODUCT($E8:$10*SUMIF(INDIRECT("'"&D$8:D$10&"'!B3:B6"),B3,INDIRECT("'"&D$8:D$10&"'!A3:A6")))
or
=SUMPRODUCT($E8:$10,SUMIF(INDIRECT("'"&D$8:D$10&"'!B3:B6"),B3,INDIRECT("'"&D$8:D$10&"'!A3:A6")))
Both methods should work. Basically you are weighting the results of each sumif sheet result by the corresponding number n your table before taking the final sum/grand total.

Related

How to count and then vlookup?

I have two spreadsheets and I want to sum up the total and then vlookup but when I do it I get 0 as a result.
Basically I have all 12 weeks, so I want to sum up all the numbers for "week 1" then vlookup the total to the other spreadsheet. the spreadsheet I want to sup up, so 7x10 = 70
the overview spreadsheet I want to get the "70" from week 1
You don't need a Vlookup, because you have many values for week 1, and no identifier for the week 1 total. Instead, on the summary sheet, you can use a Sumif() or Sumifs() function. Something along the lines of this:
=Sumifs(Sheet1!C:C,Sheet1!A:A,Sheet2!A3)
In words: Sum up all the values from Sheet1 in column C where column A in Sheet1 has the same value as cell A3 on Sheet2.
You need to adjust the sheet names and cell references to reflect your workbook.
With that approach, you do not need to enter weekly totals into your first sheet at all. It's not good practice to interrupt a table of data entry cells with formulas. It's better to do the reporting and analysis outside of the data entry table.

Sum the column in different sheets

I'm trying to sum a specific column in that repeats in some sheets with Macro Excel and I'm quite lost...
I have 10 different sheets and in each one the column that I'm trying to sum is in a different letter. Also, each sheet has a dynamic count of rows.
Could you show me what code I need to write to sum the column in all the sheets at once?
Thank you so much!
You can use this formula to sum or do anything in other sheet:
Example you want to sum the value from A1:A5 in Sheet1 and store it in the B3 in Sheet2, you can use this formula in cell B3 in Sheet2 like this:
=SUM(Sheet1!A1:A3)
Best,
Tung Duong (Thomas)

Cumulative Amounts of Dupe-only Items in a Resultant Sheet

Sheet 1 goes like this:
Sheet 2 should be like this:
ITEMS QUANTITIES
APPLE 4
GUAVA 2
Sorry for writing the spreadsheet in here, as I'm not allowed to include more than 1 image yet.
Suppose you have the following named ranges:
ITEMS being the data in ITEMS column on your Sheet1;
QUANTITY being the data in QUANTITY column on your Sheet1.
Enter the following formula in Cell D2 on your Sheet2:
=IFERROR(INDEX(ITEMS,MATCH(0,COUNTIF($D$1:D1,ITEMS),0)),"")
Please note it is an array formula which requires you to press Ctrl+Shift+Enter upon finishing the formula in the formula bar.
Drag it down until there is no more items showing up.
Then you can enter the following formula in Cell E2 on your Sheet2 and drag it down:
=SUMIF(ITEMS,D2,QUANTITY)
As you can see from the above screenshot, there may be some empty cells in Column D as I used IFERROR to return blank cells if there is no more distinct item. The corresponding quantity will be 0 consequently. You can choose to delete them or hide them on your worksheet.
By the way I am not sure why Pivot Table is out of the picture as it is actually a faster and easier approach than formula and you do not have to worry about the blank cells returned by the formula if the number of unique items is uncertain. All you need to do is to highlight the source data, insert a pivot table, and put the ITEM in Rows and QUANTITY in Values field.
EDIT: Update to also extract unique distinct values:
Enter this formula in cell A2 of Sheet2:
=IFERROR(LOOKUP(2,1/(COUNTIF($A$1:A1,Sheet1!$A$2:$A$300)=0),Sheet1!$A$2:$A$300), "")
Change 300 to the actual last row of your data and copy that formula down until it returns empty cells.
Then just use a regular SUMIF in cell B2 of Sheet2:
=SUMIF(Sheet1!A2:A300, A2, Sheet1!B2:B10)
Then, type whatever fruit you're looking for incell A2 of Sheet2. Continue like this in the following rows for all the fruits you need.

Excel formula to pull data from last 5 rows of a cell range that has new rows added daily

As the title suggests, I have a worksheet (sheet1) that has lots of data that spans columns A-E and with rows that are added daily, What I want to do is on a separate worksheet (sheet2) show the data from the last 5 rows of sheet1.
Providing there is continuous data within column A on Sheet1, you could also use the INDIRECT() and COUNTA() functions.
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-4)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-3)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-2)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-1)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A))
You would need to amend the column letter within the INDIRECT function for each column of data which you wish to view on Sheet2.
In an appropriate cell on Sheet2, use this formula,
=INDEX(Sheet1!A:A, MATCH(1E+99, Sheet1!$A:$A)-(ROW(1:1)-1))
Fill right for a total of 5 columns then fill those 5 cells down 5 rows.
That formula will find the last number in a column. This is often the case as the left-most column mat hold an ID number. The same reference point should be used to collect cell values from other columns to avoid the confusion that a rogue blank cell would create.
If all you have are text values then the formula in the first cell would be,
=INDEX(Sheet1!A:A, MATCH("žžž", Sheet1!$A:$A)-(ROW(1:1)-1))
Fill right and down as described above.

Link two cells of a column in different sheets if a value in a cell of other column matches in other sheet

I have a workbook with 7 sheets containing part number of a product in column and its cost in adjacent column. And the 7th sheet contains total number of parts in all the sheets. I want to change cost of some products but then I have to do the same in all sheets. Is there a way by which it automatically finds and changes cost in individual sheets when i change it in the sheet containing total?
Use VLOOKUP on the first 6 sheets to match the price to each part number.
So, in each "cost" column on the first 6 sheets, enter this formula (assuming Cost on Sheet7 is still in column C):
=IFERROR(IF($A1="","",VLOOKUP($A1,Sheet7!$A:$C,3,FALSE)),"")
If you have header row(s) then just replace the two instances of $A1 in the formula with whatever the first row of data is (e.g. $A2), paste the formula into that row in column C on Sheet1, then drag-copy the formula down as far as you want. Repeat for sheets 2-6.

Resources