This blog article is one out of five articles on the same subject.

Sorting text cells using array formula in excel
Sorting numbers and text cells also removing blanks using array formula in excel

Sorting numbers and text cells descending also removing blanks using array formula in excel
Sort text cells alphabetically from two columns using excel array formula
Create a drop down list containing only unique distinct alphabetically sorted text values using excel array formula
Sort a range from A to Z using array formula in excel

Question: How do I sort text values in two columns combined?

Answer:

sort-two-columns-alphabetically

Formula in D2:

=IF(ISERROR(MATCH(ROWS(D2:$D$2), COUNTIF(List1, "<"&List1)+1+COUNTIF(List2, "<"&List1), 0)), INDEX(List2, MATCH(ROWS(D2:$D$2), COUNTIF(List2, "<"&List2)+SUM(IF(COUNTIF(List2, "<"&List1)=0, 1, 0))+1, 0)), INDEX(List1, MATCH(ROWS(D2:$D$2), COUNTIF(List1, "<"&List1)+1+COUNTIF(List2, "<"&List1), 0))) + CTRL + SHIFT + ENTER copied down to D10.

The downside with this formula is that it does not work with duplicate entries.

Named ranges
List1 (A2:A5)
List2 (B2:B6)
What is named ranges?

How to implement array formula to your workbook
Change named ranges. If your list starts at, for example, F3. Change D2:$D$2 in the above formula to F2:$F$2.

Download excel sample file for this tutorial.
sort-from-a-to-z-from-two-columns.xls
(Excel 97-2003 Workbook *.xlsx)

Functions in this article:

INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range

ROWS(array) returns the number of rows in a reference or an array

MATCH(lookup_value;lookup_array; [match_type]
Returns the relative position of an item in an array that matches a specified value

INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range

IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE

COUNTIF(range,criteria)
Counts the number of cells within a range that meet the given condition

ISERROR(value)
Checks whether a value is an error and returns TRUE or FALSE

This blog article is one out of five articles on the same subject.

Sorting text cells using array formula in excel
Sorting numbers and text cells also removing blanks using array formula in excel

Sorting numbers and text cells descending also removing blanks using array formula in excel
Sort text cells alphabetically from two columns using excel array formula
Create a drop down list containing only unique distinct alphabetically sorted text values using excel array formula
Sort a range from A to Z using array formula in excel

  • Share/Bookmark

Related posts:

  1. Filter duplicates from two columns combined and sort from A to Z using array formula in excel
  2. Create a drop down list containing only unique distinct alphabetically sorted text values using excel array formula
  3. Sorting numbers and text cells descending also removing blanks using array formula in excel
  4. Sorting text cells using array formula in excel
  5. Sorting numbers and text cells also removing blanks using array formula in excel
  6. Sort a range from A to Z using array formula in excel
  7. Extract largest values from two columns using array formula in excel
  8. Extract a list of duplicates from two columns combined using array formula in excel
  9. Extract a list of duplicates from three columns combined using array formula in excel
  10. Comparing two columns and sum unique values using array formula in excel