Is there a way to reference the row above?
I'm trying to mark active child tasks in an overall task. I'd like do =IF(Done@row-1 = 1, 1, 0) in the Active Task column, but we often insert tasks and I don't want to put a hard @row number in there that would need to be maintained when new tasks are added. Same for automatic numbers in a RowID column.
I was also doing this based on status, but we have several subtasks that have the same status and we only want to add additional status' as a last resort.
Does anyone know of a way to do this with Ancestors or a helper column to show when the task above is complete and that is now the active task?
Best Answer
-
Insert an auto-number column (called "Auto) that has no special formatting.
Next insert a text/number column (called "Row") with the following column formula:
=MATCH(Auto@row, Auto:Auto, 0)
Then you can incorporate this into your formula
Row@row - 1 will always give the row above regardless of sorting, deleting, or adding rows.
Answers
-
Insert an auto-number column (called "Auto) that has no special formatting.
Next insert a text/number column (called "Row") with the following column formula:
=MATCH(Auto@row, Auto:Auto, 0)
Then you can incorporate this into your formula
Row@row - 1 will always give the row above regardless of sorting, deleting, or adding rows.
-
Amazing!! Thanks @Paul Newcome! This is so helpful!
-
Happy to help. 👍️
-
Hi
Sorry to go into an old post but this is what I want, but to look at the dates.
I want to look at moving rows which have sequential dates based on planning.
=WORKDAY([Online Date]248, 1, {Holidays Range 2})
I also want this to inherit from the date above to repopulate the sequence.
Currently, if we move a row we have to rebuild and pull down all online date formulas to rectify.
-
-
where in the formula do you incorporate the added Row@row - 1 ?
-
@cbredehoeft It depends on the formula you are currently using.
-
=MATCH(Auto@row, Auto:Auto, 0)
-
@cbredehoeft Row@row - 1 would not be incorporated into that formula. That formula is used in the [Row] column to output the row number on the sheet so that it can be leveraged by other formulas. These other formulas are where you would incorporate Row@row - 1.
-
But how? Can you give some examples so we can see it in context?
-
@Jeff Fike There are so many different ways and variations, we would need more context from you. What is it you are trying to do?
-
Assuming column A
If ancestor = 2, set Ax = Ax-1 + 0.1 (Where x = row number; and x-1 is the cell above it in the same row)
So that would mean when I have
A3 = 1 (Ancestor =1 in this case)
A4 = 1.1
A5 = 1.2
etc. for as long as A4…Az is indented (i.e. Ancestor = 2)
I essentially want it to autonumber when ancestor =2 based off of whatever number was above it
-
@Jeff Fike It sounds like you are looking for a WBS solution. If you do a search here in the Community, there is one in particular that utilizes column formulas. That is currently the most relevant.
-
I can look into it but I thought that: -set current row equal to (row-1)'s value + x which is what we were discussing here?
Additionally:
1) I will need this functionality more than just the situation I offered and it won't always be a WBS situation.
2) An example on how to use what you offered would benefit more than just me if displayed/discussed here.
-
@Jeff Fike Yes. Technically it is, but the explanations here are very simplistic compared to a WBS which is what you are looking for. Instead of trying to reinvent the wheel here, it is better to just reference the original documentation as the WBS system that you are looking for requires a few helper columns and additional formulas.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!