U
U
Urukhayy2015-04-30 13:10:58
excel
Urukhayy, 2015-04-30 13:10:58

How to make rows containing the text "N" sequential in excel?

I have an excel document. There are many lines. In some lines, in a certain cell, the word matches, say - "TheWord", but these lines are scattered throughout the table. How to make these lines in sequence?
For example, there are 10 lines with the word "Table" in a cell, and there are 10 words with the word "Street", and in one cell these two words cannot occur. So, these lines are arranged in succession (first a line with the word Table, then with the word Street, then again Table, etc.). It is necessary that first there are 10 lines with the word Table, and then 10 lines with the word Street.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
John Smith, 2015-04-30
@Urukhayy

Implementation may vary.
Depends, in particular, on how many columns in the table in which to search for a word - one or more; how many search words (for example, if there are a lot of them, then IF will be inconvenient, if not impossible, to use). Suppose there is one column, and this is column A, and there are two search words, Table and Street.
Create an additional column B with a formula like,
Drag it down parallel to the original data. Then the keywords Table\Street for each row will be selected in column B, and other if the row does not contain any key values.
Now you can select columns A and B, and sort by the values ​​of column B.
If there are more keywords, then due to the limitation of the number of nesting of the IF function, this approach will not work. Then it is better to use the option with the CHOOSE function:
Works the same way - stretch, sort by the second column.
Each new keyword is added to the first CHOOSE argument as an element
where keyword_n+1 is the keyword you are looking for, and [index+1] is the next index in order. As a result, the first argument to CHOOSE is reduced to a numeric value equal to the index of the searched element*. At the end of the formula is a list of values ​​returned by this index. Add the new keyword as a text string to the end.
Attention, unlike the first method, if there are no keywords in the text, it gives an error "#VALUE!" (instead of "other" as in the previous example).
* Works correctly provided that a line cannot contain more than one keyword at the same time. If you have a line where there is both Street and Table, you get garbage. The same applies to the previous method.

E
Evgeny Komarov, 2015-04-30
@maNULL

sort by column in table, no?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question