Welcome to the Smartsheet Forum Archives
The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.
公式determine row number
Hello,
I am wondering if there is a way to determine the row number of a specific row. I know this can be done in Excel with the row() function. This does not work in Smartsheet. The reason I am looking for it is because I have a formula that needs to apply to every row that checks the row above it, but that fails when it is in the first row. I can't just have a static first row because the entries move around based on priority.
If there is a way to determine the row, the formula can check if it is in the first row, and then act accordingly.
Thanks,
Fred
Comments
-
J. Craig Williams ✭✭✭✭✭✭
Fred,
没有。
I use a simple column [RowID] with the value 1 in row 1 and this formula in row 2:
=[RowID]1 + 1
I then copy that to the rest of the column.
It breaks when rows are added or deleted. Copy-drag fixes that.
I only keep it updated when I am sorting or working with dependencies - I make the font BIG AND BOLD so I can see it easier than the greyed-out row ID.
Craig
-
Rob Hagan ✭✭✭
Hi Fred,
There is, provided that you are OK using two columns to achieve the outcome.
Let's assume that we have two columns at our disposal named Column2 and Column3.
In the first row of Column2 put the formula =1+0 and then copy it down to the end of the used rows.
In the first row of Column3 put the formula =COUNT([Column2]$1:[Column2]1) and then copy it down to the end of the used rows.
Column 3 will now contain the row number.
This survives both addition and deletion of rows, provided that SmartSheet's auto-filling meets its contractual commitments.
Cheers,
Rob.
-
Thank you Craig and Rob. Both are reasonable solutions, though Rob's is more robust.
However, in my situation, it doesn't help as I thought it would. The IF statement that checks if it is in row 1 still gives me the #UNPARSEABLE error in the first row, because there is no cell above the first to reference. The ability to reference a non-existent row is not dependent on the IF statement. I should have seen this coming...
The only other way I can think to solve this would be to use a cell value as the row number, but this doesn't seem to be possible in Smartsheet.
Thank you for your help!
Fred
-
J. Craig Williams ✭✭✭✭✭✭
Brilliant Rob.
Looks like I have something for my pathfinder list.
Fred,
If you are using Fred's method (and you should) and still getting #UNPARSEABLE then you are speaking about another formula somewhere else.
Use either
=IF([Column3]1 = 1, (do stuff because you are on row #1), (do other stuff))
and copy those down in your column.
or
=IFERROR((do stuff you want to do), "error - hmm, might be on Row 1")
That should fix you right up.
Craig
-
J. Craig Williams ✭✭✭✭✭✭
Shaine,
Please mark Rob's answer as the Best Answer.
Very much wish I had thought of that.
Craig
-
Ezra ✭✭✭
要依靠这. .我想要一个干净的to make every-other column a grey background. I just wanted a 0 or 1 to provide a conditional formatting rule some meat to chew on. Instead of two rows, I'm using a [Data] column (assuming that I'll always have information in the Data column).. and a [Style]
=MOD(COUNT([Data]$1:[Data]@row), 2)
then I wanted to make a distinction between indented row levels and the parents...
=MOD(COUNT([Data]$1:[Data]@row), 2) + IF(COUNT(ANCESTORS()) = 0, 1, 0) + IF(COUNT(ANCESTORS()) = 1, 10, 0) + IF(COUNT(ANCESTORS()) = 2, 20, 0) + IF(COUNT(ANCESTORS()) = 3, 30, 0) + IF(COUNT(ANCESTORS()) = 4, 40, 0) + IF(COUNT(CHILDREN([Data]@row))> 0, 5, 0)
......the last part needs to be looking at something other than COUNT(CHILDREN()) or you get circular ref errors
-
Paul Newcome ✭✭✭✭✭✭
Stumbled across this looking for something completely unrelated and figured I'd put my two cents in. My solution is very similar to Rob's except I only use one helper column and any other column that's on the sheet.
The helper column formula would be
=COUNTIFS([Any Column]$1:[Any Column]@row, OR(ISBLANK(@cell), NOT(ISBLANK(@cell)))
.
You can use this to look at any column you want that's already on the sheet, and it will count from row 1 to the current row how many cells within the range are either blank or not blank.
10xViz
-
Andrée Starå ✭✭✭✭✭✭
Excellent!
It will probably work for my TOC solution and more.
Thanks!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå| Workflow Consultant / CEO @WORK BOLD
W:www.workbold.com| E:[email protected]| P: +46 (0) - 72 - 510 99 35
Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.
-
Paul Newcome ✭✭✭✭✭✭
That's actually how I am using it. As a sort of TOC at the top of my Project Plans. I have two helper columns. One that pulls the row number for each parent task, and the other pulls the task name.
I then collect all of the At Risk Tasks with their column numbers and swapped out my workaround for a line break with the new CHAR(10).
If none are at risk, the cell at the top just says "On Track. No Deliverables At Risk."
If one or more are at risk, It changes to provide instructions on how to use CTRL + G to jump to a specific row, and lists out each row number/parent task that is at risk kind of like so...
"Use Ctrl+G and enter the row number yada yada yada"
3: Task Name on Row 3
28: task Name on Row 28
487: Task Name on Row 487
.
Once it is no longer at risk, it disappears from the list. Anything else that becomes at risk is automatically added to the list in numerical order.
10xViz
Categories
=IF(COUNT(CHILDREN()) = COUNTIFS(CHILDREN(), @cell = \"Canceled\"), \"Canceled\", IF(COUNT(CHILDREN()) = COUNTIFS(CHILDREN(), OR(@cell = \"Complete\", @cell = \"Canceled\", @cell = \"On Hold\")), \"Complete\", IF(COUNT(CHILDREN()) = COUNTIFS(CHILDREN(), @cell = \"Not Started\"), \"Not Started\", IF(COUNTIFS(CHLDREN(), @cell = \"Upcoming\")> 0, \"Upcoming\", \"In Progress\"))))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":219,"urlcode":"Sheets","name":"Sheets"},{"tagID":254,"urlcode":"Formulas","name":"Formulas"}]},{"discussionID":108239,"type":"question","name":"Is an automated export of a Smartsheet to an Excel file possible?","excerpt":"Hi all, I have been having the most frustrating conversation with Smartsheet support on this topic and not getting answers to the question that I asked. I would like to set up an automation that will email me an Excel copy of my project plans on a weekly basis (or when triggered with a change - I don't really care) as I…","snippet":"Hi all, I have been having the most frustrating conversation with Smartsheet support on this topic and not getting answers to the question that I asked. I would like to set up an…","categoryID":321,"dateInserted":"2023-07-28T02:36:12+00:00","dateUpdated":null,"dateLastComment":"2023-07-28T06:42:13+00:00","insertUserID":164243,"insertUser":{"userID":164243,"name":"Candace G","title":"Senior Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/Candace%20G","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-07-28T06:50:48+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":137040,"lastUser":{"userID":137040,"name":"Gia Thinh","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Gia%20Thinh","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!pXMt6Y5Kqjs!ZHDtmZp0Yms!Dwma-t47hzh","dateLastActive":"2023-07-28T09:26:06+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":28,"score":null,"hot":3381040105,"url":"https:\/\/community.smartsheet.com\/discussion\/108239\/is-an-automated-export-of-a-smartsheet-to-an-excel-file-possible","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108239\/is-an-automated-export-of-a-smartsheet-to-an-excel-file-possible","format":"Rich","tagIDs":[268,300,334,440,445],"lastPost":{"discussionID":108239,"commentID":387741,"name":"Re: Is an automated export of a Smartsheet to an Excel file possible?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/387741#Comment_387741","dateInserted":"2023-07-28T06:42:13+00:00","insertUserID":137040,"insertUser":{"userID":137040,"name":"Gia Thinh","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Gia%20Thinh","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!pXMt6Y5Kqjs!ZHDtmZp0Yms!Dwma-t47hzh","dateLastActive":"2023-07-28T09:26:06+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-07-28T06:32:42+00:00","dateAnswered":"2023-07-28T05:49:42+00:00","acceptedAnswers":[{"commentID":387737,"body":"
Hi Candace,<\/p>
The answer is YES. You can use \"Send as Attachment\" feature in the File menu of your sheet to setup the schedule for your need. You should be a licensed user to use this feature as well (I remembered that). <\/p>
Hope this works for you.<\/p>