How to count and then vlookup? - excel

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.

Related

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)

How to check if any day of given week number falls between range of date intervals

I have a sheet (1) where header cells of columns hold week numbers and dates of mondays per every week.
Then i have another sheet (2) of reservations. I would need to create reservation view to sheet 1 where each cell of each resource row checks from sheet 2 if any day in current week hits any reservation from sheet 2 and return a number for that cell (for formatting purposes, number 1 in example below). There are multiple rows in sheet 2 for each unique resource, so i could not use VLOOKUP, since it returns only first occurrence.
Those numbers 1,2,3,4... in sheet 1 are ISO week numbers 1-53.
Sheet 1:
Sheet 2:
I've tried to approach this with IF/AND/VLOOKUP, but with no success...
=IF(AND(D$7>=VLOOKUP(B9;gantt_data!$A$3:$E$52;4;FALSE);D$7<=VLOOKUP(B9;gantt_data!$A$3:$E$52;5;FALSE);;);1;)
Thank you for help already!
You can try SUMPRODUCT function:
=IFERROR(1/SUMPRODUCT(($B4=$A$16:$A$24)*((DATEVALUE(C$2 & C$1)+7)>=$C$16:$C$24)*(DATEVALUE(C$2 & C$1)<$D$16:$D$24));"")
I believe a simple COUNIFS will do the job. Please try this formula. Paste it into your cell B9 of your table on Sheet1 and copy it from there to the right and down as required.
=COUNTIFS(Table1[Task Name],$A10,Table1[Reservation start],"<=" & B$7,Table1[Reservation end],">" & B$7+7)
Note that I presumed your Sheet2 to hold Table1. Please replace the range with another name if a range Table1 doesn't comprise of the DataBodyRange of your table on Sheet2. To avoid seeing all the zeroes please format the cells with the formula as Custom 0;;

SUMPRODUCT on all sheets with sheet multiplier

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.

Multiple criteria to sum a range of data

I'm using Excel 2013:
I calculated when income/expense would fall on a given date in the year: Budget sheet on top, Event Calc sheet on bottom
On my "Budget Adjust" sheet, I then wanted to sum the amounts with the criteria of: 1) within two dates and 2) matching the income/expense type:
While I now understand that I can't use SUMIFS (because my data to sum and date criteria are different sizes), I'm wondering if any of you have a brilliant idea about how to sum the data for specific date ranges and a type match.
ADDITIONAL INFO: Using the data in the first few columns, I created a dynamic formula for each day in the year, so columns T:NV, with a day of the year in Row 1:
=IF($D2<>0,IF(AND(U$1>=$C2,(U$1-$C2)/$D2=ROUND(((U$1-$C2)/$D2),0)),$B2,0),IF(DAY(U$1)=$E2,$B2,0)).
For that day of the year, for the type of income/expense, it would enter either the income/expense that would fall on that day, or zero. There are 365 such columns (T:NV), one for each year.
My attempt was to use the range of data (T2:NV20) in one formula on the Budget Adjust sheet that would search for: 1) within a given date rage, and 2) for each Type, then return the Sum of the amounts found within that date range
--- EDIT ---
I want an elegant answer, with one formula in the results field, but here's how I've made it work:
I'm limited to two pics per post, so here is a pic of both sheets:
My work-around to get the answer
On top is is the Event Calc page, where I've created a column for each month, and H2 is highlighted with the formula above:
=SUMIFS($U2:$NV2,$U$1:$NV$1,">="&H$1,$U$1:$NV$1,"<"&I$1)
On the bottom is the Budget sheet with D9 (Salary for Jan-2016) highlighted:
using this formula:
=SUMIFS('Event Calc'!H$2:H$20,'Event Calc'!$A$2:$A$20,"="&$B9)
Why wouldn't you just use 'Event Calc' columns A, B and C? That is already in a proper format for a SUMIFS formula. On sheet "Budget Adjust" cell D17, use this formula:
=SUMIFS('Event Calc'!$B:$B,'Event Calc'!$A:$A,$B17,'Event Calc'!$C:$C,">="&D$10,'Event Calc'!$C:$C,"<="&D$11)
and then copy right and down

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