
Originally Posted by
Pete_UK
In the first formula I gave you, this part:
ROUND(B1+0.01,2)
just adds 0.01 to the previous value, so it forms a simple counter as it is copied down the column, but this is part of an IF statement, so it only does that if A2 is not blank. If it is blank, then the formula will return a value which is the next whole number by means of this part:
INT(MAX(B$1:B1))+1
(i.e. find the largest number of all the previous cells, take the whole number part of it, and then add 1), but it will only do this if the next cell in column A is not blank - in this case it will return a blank, as that represents the end of the series of tags. So, we end up in column B with a series of numbers, where the decimal values are a count of the number of tags we have in a particular sentence, and the whole number part represents the sentence number, and a whole number with no decimal values indicates a new sentence. That means that we then need another formula which will make use of rows and columns to enable us to extract data in the correct sequence - we effectively want the tags from column A which have this pattern of numbers:
0.01, 0.02, 0.03, 0.04, 0.05, and so on
1.01, 1.02, 1.03, 1.04,
and so on.
That is what the second formula does - it uses ROWS($1:1)-1 to form the integer part, (and this will increment on successive rows), together with COLUMNS($A:A)/100 to form the decimal part (which will increment on successive columns), and the MATCH function attempts to find where this number exists in column B. If there is an exact match, the INDEX function will return the corresponding value from column A, but if not the IFERROR function ensures that a blank cell is returned instead.
Hope this helps.
Pete
Bookmarks