I have some data which includes a list of tasks for 2 individuals.
I want to represent this data in the following format.
So that it looks like the below.
How can I achieve this with the use of formulas?
[EDIT]
I don't think this question is the same as 'Data Wrangling in Excel - Rearranging Columns and Rows' as mine is about reflecting schedules in a more gantt chart-esque like format, whereas the other question seems to be more about transposing data.
Not sure if you have your desired output on the same sheet or a new sheet, but I used a new sheet starting in cell A1. The source datasheet is referred to as S1 in the formulas.
Assumptions:
Column C = Date Start
Column D = Date End
Persons' entries are grouped together (Person1, Person1, then Person2; never Person1, Person2, Person1)
Person can't be assigned two different areas for the same timeframe (e.g., Person1 can't have A and B for a given month)
Your desired dates are always the first of the month
Output/Formulas:
A1 is blank
A2: =INDEX('S1'!$A$1:$A$6,IFERROR(MATCH(A1,'S1'!$A$1:$A$6,0),1)+COUNTIF('S1'!$A$1:$A$6,A1))
A3: Formula copied down from A2
B1: =IF(A1<>"",EDATE(A1,1),MIN('S1'!$C$1:$D$6))
C1 to J1: Formula copied from B1
B2: =INDEX('S1'!$B$1:$B$6,MATCH(1,INDEX(('S1'!$A$1:$A$6=$A2)*('S1'!$C$1:$C$6<=B$1)*('S1'!$D$1:$D$6>=B$1),0),0))
B3 and C2 to J3: Formula copied from B2
Explanations:
The A2 formula: Looks at where the previous Person entry first occurs (MATCH part), and counts how many entries it has (COUNTIF part) to determine the next Person entry in line (INDEX part). The IFERROR portion is used to return the first Person entry, which is assumed to be on row 1.
The B1 formula: Adds one month to the previous date heading (EDATE part). The very first date heading looks for the earliest date in your source data (MIN part).
The B2 formula: Uses a match with multiple criteria on your source data (Person entry must match the indicated person, start date must be before or on the date heading, and end date must be after or on the date heading). The second INDEX creates an array of the combined criteria results (1 if true, 0 if false), and the MATCH returns which entry that is. The first INDEX returns the task (A, B, or C).
Related
I need to determine if a product has shipped based on two different cells that may or may not have a date or be empty.
Basically I have today's date, =Today(), in cell A1. Starting in Row 10 I have information that includes products with ship dates. I need to list if the product has shipped or not in Column L. Ship date if known is in column K, if it's not known the cell in column K is empty. What I need to achieve is, if the cell in column K is blank the cell in column L should also be blank, if the date in column K is today's date or past (referenced to cell A1) then column L should read "Shipped", if the date in column K is in the future the cell in column L should read "Forecast".
I am having trouble nesting the criteria. I've used =IF(K10<=$A$1,"Shipped","Forecast") which tells me if it shipped or is still Forecast to ship but does not take into consideration a blank cell in column K (a blank cell currently shows it has shipped) where I don't know the ship date yet.
Try the following:
=IF(K10="","",IF(K10<=$A$1,"Shipped","Forecast"))
You could use one IF() with AND() for the same :
=IF(AND(K10<>"",K10<=$A$1),"Shipped","Forecast")
This question is based on the answer provided in the thread linked below. I have the same question byt my data is ordered a bit different.
Find row when Cumulative sum reaches certain value with condition
In sheet1 I have columns ID, COST and Profitability Date. (ABC)
In sheet2 I have a date row (ex 201801) running horizontally starting in B1 (B1,C1 etc..). Starting in A2 i have the different ID's running vertically. The Revenue for each ID follows beneath the date row.
I would like to have the formula in Profitability Date (sheet1 column C) to return the date (sheet2 row 1) when the cost (sheet1 column B) is >= than the revenue in sheet2.
Enter the following array formula in C2, confirm with CONTROL+SHIFT+ENTER, and copy down:
=INDEX(Sheet2!$B$1:$J$1,MATCH(TRUE,SUBTOTAL(9,OFFSET(INDEX(Sheet2!$B$2:$J$4,MATCH(A2,Sheet2!$A$2:$A$4,0),0),,,,COLUMN(Sheet2!$B$1:$J$1)-COLUMN(Sheet2!$B$1)+1))>=B2,0))
There is the issue
I wonder if there is a way like if there is date(or text,e.g.) on B1 cell then copy B1 data to the range A2-A19, until the next cell with data (B20) and so goes on. Because on much data cannot be done by hand.
If the "date" values in column B are actually text, then enter into A1:
=IF(ISERROR(AND(FIND("/";B1)=3;FIND("/";B1;4)=6));OFFSET(A$1;ROW()-2;0);B1)
This tests for cell B1 having a "/" character at the third and sixth positions in the string.
If the "date" values are in column B are actually entered into the spreadsheet as dates, then enter into A1:
=IF(YEAR(B1)<1950;OFFSET(A$1;ROW()-2;0);B1)
This tests for the integer value of B1 (in the case of a date, this value is the number of days since December 31, 1899) falling in a year earlier than 1950. You may have to adjust 1950 to a different year depending on the details of your data.
In either case, if the test fails then the value from the previous row of column A is displayed (offsetting cell A1 by the current row minus two: for example on row 3, A1 will be offset by 3-2= 1 and A1 offset by 1 is A2).
If the test succeeds then the value from the corresponding row in column B is displayed.
The $ in the A$1 will keep that value constant when the formula is copy-pasted, so the offset calculation will work correctly. All the other values will adjust appropriately when you copy-paste down the row.
So at the top of my Excel sheet I have 2 cells, A2 and B2, where people can enter a starting and ending date.
On a seperate sheet I have an enormous list of starting and ending dates in columns A and B, and corresponding data for each of these 'events' in columns D through G. I need my function to copy all rows where the starting date falls between the two specified dates, and copy the data to the first sheet, in cells A4 - G4 through A100 - G100. (I just chose 100 as a large number, to make sure the area where the data gets placed is large enough)
I'm guessing this function I need includes the INDEX function, but I only know how to use it to look up one data cell at a time, not how to copy an entire range of cells.
Can anyone help?
No helper columns required.
Enter this formula into cell A4:
=IFERROR(INDEX(data!D$2:D$9999,SMALL(IF((data!$A$2:$A$9999>=$A$2)*(data!$A$2:$A$9999<=$B$2),ROW(data!$D$2:$D$9999),9E+99),ROW(1:1))-1),"")
This is an array formula and must be confirmed with Ctrl+Shift+Enter.
Now copy the formula to the range B4:D4.
Now copy the A4:D4 to the range A5:D100.
That's it.
Let's say Column C in the data sheet is blank, and free to add a formula.
Let's also assume that the data begins in row 2.
Then the following formula can be put in C2 & copied down:
=IF(AND(A2>=Sheet1!$A$2,B2<=Sheet1!$B$2),C1+1,C1)
Basically it is saying that if the beginning date of the current record is greater than or equal to the date the user is looking for, and the ending date is likewise within range, iterate the record, otherwise not.
At this point the user sheet can have a simple VlookUp as follows:
In D1: =VLOOKUP(ROW($A1),Sheet2!$C:$G,COLUMN(B$1),0)
Copy this across to G and down however many rows you like.
On Sheet1 I have a table across several columns with dates (quarters, say: 03/31/2014, 06/30/2014 and so on) in the first cell of each column.
On Sheet2 I have another table with four columns where I want to fill each first cell with the quarterly dates from the table in Sheet1. However the dates to be chosen depend on another cell (containing a date value).
For instance, if we are in May (reference cell) I want to populate the first cell in Column1 with the last quarter before May (ie 03/31/2014) and the other three first cells with the subsequent quarter-end dates, so the second column would lookup 06/30/2014 from Sheet1, and so on.
An alternative to looking up the dates might be to create them in the second sheet. If the columns there were A:D then, in A1:
=CHOOSE(MOD(MONTH(G1),3)+1,EOMONTH(G1,-3),EOMONTH(G1,-1),EOMONTH(G1,-2))
and in B1 copied across to D1:
=EOMONTH(A1,3)
where G1 is assumed to be the reference cell.