rows function not returning the expected result

I would like to sort this data out initially by column C, the #, and then by the item name.



Ultimately I will then generate a new calculated # which will be the original # if it exists, or a serial number that follows on from the last known #.


In trying to do this, I have come across what appears to be an inconsistency in the rows() function and want to confirm that I am not going daft. I have an alternative method using countif() for generating the calculated #.


Here is the issue:

Column D contains simple row functions, for example D11 contains =ROW($A11). It should and does return 11.



Notice that item VB is in row 14 and the function in D14 returns 14, as expected.





When I sort the data, based on # first, and then item name second, the sort produces the correct results but the row() functions return the incorrect values, the values from before the sort.



item VB has correctly moved to row 11 but the formula in column D is still returning the value 14, i.e. rows() returns the incorrect result.


This behaviour only seems to occur when sorting while categories are enabled.

If categories are turned off and then back on again, the rows functions return the correct values.


Is this behaviour intentional?



[Edited by Moderator]

Posted on Sep 6, 2025 3:24 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 6, 2025 4:04 AM

It appears to be from it being a categorized table. There is a glaring bug when using functions like INDIRECT, OFFSET, INDEX, and FORMULATEXT in categorized tables if the table is sorted or if rows are moved around any other way. They do not update. It looks like ROW is another one for the list. I don't know how long it has been going on but I reported it to Apple 2 1/2 years ago. One day they may get around to fixing bugs but it does not appear to be of any priority to them. I take every opportunity to bash them here for not fixing bugs that have plagued Numbers for YEARS and over multiple versions/releases.


The workaround is to switch off categorization then switch it back on, as you have discovered.

1 reply
Question marked as Top-ranking reply

Sep 6, 2025 4:04 AM in response to IHadaName

It appears to be from it being a categorized table. There is a glaring bug when using functions like INDIRECT, OFFSET, INDEX, and FORMULATEXT in categorized tables if the table is sorted or if rows are moved around any other way. They do not update. It looks like ROW is another one for the list. I don't know how long it has been going on but I reported it to Apple 2 1/2 years ago. One day they may get around to fixing bugs but it does not appear to be of any priority to them. I take every opportunity to bash them here for not fixing bugs that have plagued Numbers for YEARS and over multiple versions/releases.


The workaround is to switch off categorization then switch it back on, as you have discovered.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

rows function not returning the expected result

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.