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))
Related
I need a formula in Excel that will count the number of unique IDs in one column if the value of another columns matches what is in a specific cell in a third column.
COLUMN A - Code 1, COLUMN B - ID Number, COLUMN C - Code 2, COLUMN D Number of Unique Firms by Code, COLUMN E - What the formula should return as answers
Desired Formula - Count the number of unique ID Numbers in B anytime C (Code 2) matches what is in cell A2 (From Column Code 1)
Then do the same for cell A3, A4, etc.
Notes:
I am working across multiple Excel sheets and there are close to 200,000 rows, but for simplicity sake I am putting everything in one sheet and only 15 rows on the image.
I have Microsoft Home and Student 2019
In D2 enter this array-formula with ctrl+shift+enter and drag down:
=SUM(--(FREQUENCY(IF($C$2:$C$15=$A2,$B$2:$B$15),$B$2:$B$15)>0))
It counts the number of unique values in B2:B15 where the value in C2:C15 equals the value of code1 in the current row.
I've been trying to come up with a formula to sum a specific amount.
It has 3 criterias: 1st is an account number: column A; 2nd is a Cost Center number: column C; and 3rd is a date from line i1 to T1 (eg.:i1= jan/2020; t1=dez/2020).
The dates are formated with "date" type: mar/12 on both sheets.
The date on the formula refers to a specific cell $F$2 in order for me to just comeback there, type the month that i want and it automatically calculates the values while taking into account the other criterias.
This is the formula i adapted from some research.
=SUMPRODUCT(Sheet2!$A:$A=Sheet1!$C20)*(Sheet2!$C:$C=Sheet1!$H3)*(Sheet2!$I$1:$T$1=Sheet1!$F2)*(Sheet2!$I$2:$T$635)
This formula currently gives back 0 instead of the value pretended (which is ~631)
Here are 2 prntscreens as form of sample, i hope it helps.
Sheet1 with formula
Sheet2
Thank you.
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).
I am very new in Excel and I have to implement this pretty complex task (at least for me it is complex).
I put what I am doing here: https://drive.google.com/open?id=1sWHbyl-Y-GgSiX7JJ3bJ9_y8DUts-E0e
I will try to explain exactly what I have to do:
For each rows I have to "calculate" the value of the L column in this way.
Each cell into the L column is "calculated" using the following steps:
Considers the date into the H column of this row.
Search the nearest date in the past into the A column to select a specific row.
Take the E column value of this row and use it to populate the current L cell.
So doing a practical example, I want to populate the L3 cell, I have to do:
Considers the date into the H column of this row: so I obtain the value of the H3 row that is this date: 16/12/2017.
Then, into the whole A column I search the nearest date in the past in this column (in this case it is 15/12/2017), so I select the row number 4.
Take the value of E4 cell value (598,05 €) and write it into my L3 cell.
How can I do something like this?
Thank you
This is a simple INDEX(...,MATCH()) situation.
=INDEX(E:E,MATCH(H3,A:A,1))
This will return the value in column E such that the date in column A is the greatest date less than or equal to the value in H3.
Note: This assumes the dates in column A are sorted in ascending order.
VLOOKUP:
=VLOOKUP(H3,A:E,5,TRUE)
This requires the dates in Column A to be sorted.
I would like an excel formula for the below. For each month (columns) I have a total (all in same row). I want to sum the range of totals and highlight the month in which the cumulative sum of months turns positive. These totals will change based on other variables.
Columns = A1 through L1 (months)
Totals in row B for each month
Assuming your cumulative total will be in row 3, in A3 you would put the formula:
=SUM($A$2:A2)
note the dollar signs in the first part of the range. When you now copy it down the row the second part will change creating a cumulative sum of the total values.
To highlight the first positive value you would select the whole range of cumulative values (say A3:X3) and create New Rule for conditional formatting, select "Use a formula to determine which cells to format", and place the following formula as the condition:
=A3=MIN(IF($A$3:$X$3>0,$A$3:$X$3,""))
Which will highlight the lowest non negative value in your row with the formatting you select. Hope this helps. Regards,