I have a list of project IDs with start and end dates listed by the numbered day and month. (EX august =8, 1st =1) I have a calendar on another sheet with the month and day numbers in their own cells. I want the project ID to populate in the cell where the month and day numbers on the two sheets match.
Example = if A1 + A2 on Sheet1 Match A1 & A2 on Sheet2, Populate The Project ID here.
Can someone help me figure out the easiest way to do this?
If you have a data like this (in Sheet 1 for this example):
You can use this array formula (don't forget to press Ctrl+Shift+Enter) to populate the ID when the day and month number match:
=INDEX(Sheet1!$A$1:$A$6,MAX((A2=Sheet1!$B$2:$B$6)*(B2=Sheet1!$C$2:$C$6)*ROW(Sheet1!$B$2:$B$6)))
The brackets at the beginning and end of the formula is because it's an array formula.
I let you an example here: https://docs.google.com/spreadsheets/d/1xVmoZ8cGURuwnYF8AsLkozWUIxc5nPmt/edit?usp=sharing&ouid=109997475435544900987&rtpof=true&sd=true
Related
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;;
Suppose the value of cell A1 is total sales $ at the Los Angeles location, year to date. The value is pulled from a pivot table on a different sheet.
The formula for A1 is:
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",{7,8,9,10,11,12}))
Currently, every month when I run this report I need to manually update the month arrays in the formulas; for example next month I will need to manually update {7,8,9,10,11,12} to {7,8,9,10,11,12,1}. There are many cells and this is a very tedious task.
My question is how can I automate the task of updating the month array in the GETPIVOTTABLE formula?
What I've attempted with no success: I set up a 2-column lookup table on a different sheet where column A is the current month and column B contains the month array value to be used in the GETPIVOTTABLE formula. For example:
7 {7}
8 {7,8}
9 {7,8,9}
etc...
Then I tried updating my GETPIVOTTABLE formula to use a VLOOKUP to get the month array:
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",VLOOKUP($B$2,$L$9:$M$20,2,FALSE))
But it didn't work - I get a #REF! error.
Thanks in advance for your help.
You can give a range instead of the vlookup and enter the numbers 7,8,9 . . . . in that range for example your formula
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",{7,8,9,10,11,12}))
will become
=SUM(GETPIVOTDATA("Amount",'Transactions(Pivot)'!$A$75,"Location","Los Angeles","Months",A1:A7))
and A1 to A7 contains the months.
after entering this formula press Ctrl+Shift+Enter
I need to find the sum of the cells in a Column if their end dates in another column occur in the current month.
I tried using the formula =sumif(L:L,MONTH(TODAY()),J:J) but it doesn't work.
Column L contains the full date (ex: 12/1/18).
Column J contains the values I want to add up.
So since it's December, I want to add all the values in J that have a date that is in December, and so on a so forth when I use the sheet in January.
Try this formula:
=SUM(IF(MONTH(L:L)=MONTH(TODAY()),J:J,0))
and enter it with Ctrl-Shift-Enter as it is an array formula.
Or use =SUMPRODUCT((J:J)*(MONTH(L:L)=MONTH(TODAY())))
2 cells with =TODAY()-WEEKDAY(TODAY())+1 and =TODAY()-WEEKDAY(TODAY())+7. One for this week first day and the other one for the last day of the week. How to get data from this week. Am I going to use VLOOKUP? or something formula. Thanks
I am trying return data that matches these dates. For example on the other sheet i do have date 5/29/2018,5/27/2018 ,4/27/2018 and has data values , and on the other sheet i created summary for data where this week from the first day of the week today to last day of the week today 5/27/2018- 6/2/2018 where those data will be the output the data of 5/29/2018,5/27/2018
These are the dates that i will get from 5/27/2018 - 6/2/2018
enter image description here
FROM THE DATA HERE
enter image description here
I will get the PRF Control # from the dates that will pass through 5/27/2018- 6/2/2018
Sounds like you may be after an index match.
This is the formula in the summary sheet cell B4 and then dragged down for 7 rows to cover selected week:
=IFERROR(INDEX(Sheet1!A:A,MATCH(A4,Sheet1!$C:$C,0)),"")
Summary sheet has the two cells (B2 and C2) which determine the week dates to match on or between.
Summary sheet
The data sheet (sheet1) which is referenced by the formulas:
The formula attempts to match the dates in summary sheet, with Match function, and uses the position number returned as the row number to Index, which then pulls the PRF Control # in the same row.
I am creating a spreadsheet with all my data on one sheet and metrics on the other.
On sheet 1 in cells A2:A50 I have the dates in this format (4/5/13). On sheet 2 in cell E5 I have April and I want it to total the number of PO's created in F5.
How can I do this?
I have tried using
=COUNTIF('2013'!$A$2:$A$50,'2013 Metrics'!E5).
I have a feeling that since my range is in 4/5/13 format and my criteria is April that won't work.
I was able to use this formula for total spend by month:
=SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
but not luck with how many PO's by month.
Use a pivot table. You can manually refresh a pivot table's data source by right-clicking on it and clicking refresh. Otherwise you can set up a worksheet_change macro - or just a refresh button. Pivot Table tutorial is here: http://chandoo.org/wp/2009/08/19/excel-pivot-tables-tutorial/
1) Create a Month column from your Date column (e.g. =TEXT(B2,"MMM") )
2) Create a Year column from your Date column (e.g. =TEXT(B2,"YYYY") )
3) Add a Count column, with "1" for each value
4) Create a Pivot table with the fields, Count, Month and Year
5) Drag the Year and Month fields into Row Labels. Ensure that Year is above month so your Pivot table first groups by year, then by month
6) Drag the Count field into Values to create a Count of Count
There are better tutorials I'm sure just google/bing "pivot table tutorial".
For anyone finding this post through Google (as I did) here's the correct formula for cell F5 in the above example:
=SUMPRODUCT((MONTH(Sheet1!$A$1:$A$50)=MONTH(DATEVALUE(E5&" 1")))*(Sheet1!$A$1:$A$50<>""))
Formula assumes a list of dates in Sheet1!A1:A50 and a month name or abbr ("April" or "Apr") in cell E5.
Make column B in sheet1 the dates but where the day of the month is always the first day of the month, e.g. in B2 put =DATE(YEAR(A2),MONTH(A2),1). Then make E5 on sheet 2 contain the first date of the month you need, e.g. Date(2013,4,1). After that, putting in F5 COUNTIF(Sheet1!B2:B50, E5) will give you the count for the month specified in E5.
I would add another column on the data sheet with equation =month(A2), then run the countif on that column... If you still wanted to use text month('APRIL'), you would need a lookup table to reference the name to the month number. Otherwise, just use 4 instead of April on your metric sheet.
use count instead of sum in your original formula u will get your result
Original One
=SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
Modified One
=COUNT(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
AND USE ctrl+shift+enter TO EXECUTE
Recommend you use FREQUENCY rather than using COUNTIF.
In your front sheet; enter 01/04/2014 into E5, 01/05/2014 into E6 etc.
Select the range of adjacent cells you want to populate. Enter:
=FREQUENCY(2013!!$A$2:$A$50,'2013 Metrics'!E5:EN)
(where N is the final row reference in your range)
Hit Ctrl + Shift + Enter
Sooooo, I had this same question. here's my answer: COUNTIFS(sheet1!$A:$A,">="&D1,sheet1!$A:$A,"<="&D2)
you don't need to specify A2:A50, unless there are dates beyond row 50 that you wish to exclude. this is cleaner in the sense that you don't have to go back and adjust the rows as more PO data comes in on sheet1.
also, the reference to D1 and D2 are start and end dates (respectively) for each month. On sheet2, you could have a hidden column that translates April to 4/1/2014, May into 5/1/2014, etc. THen, D1 would reference the cell that contains 4/1/2014, and D2 would reference the cell that contains 5/1/2014.
if you want to sum, it works the same way, except that the first argument is the sum array (column or row) and then the rest of the ranges/arrays and arguments are the same as the countifs formula.
btw-this works in excel AND google sheets. cheers