## Sort cell values in corresponding columns

*Article updated on February 25, 2013*

Calling columns A and B as data(text), C and D as Dates(dd/mm/yy),

IF column D's date is not empty and matches to the range, concatenate A & B and paste in in different sheet,

ELSE column C's date(column C will always have a date unlike column D) should be taken for range calculation and then concatenate A & B cells and paste in a cell.

Please do help in regards to this query

**Answer:**

The two pictures below are from the same worksheet.

**Data**

**Sorting**

**Array formula in cell G1:**

**How to enter an array formula**

- Select cell G1
- Click in formula bar
- Paste array formula to formula bar

- Press and hold CTRL + SHIFT
- Press Enter

**How to copy the array formula**

- Copy cell G2
- Paste to cell range H2:R2
- Copy cell range G2:R2
- Paste to cell range G3:R10

**Download excel *.xlsx file**

Extract unique distinct values from a filtered table [udf and array formula]

Robert Jr asks: Oscar, I am using the VBA code & FilterUniqueSort array to generate unique lists that drive Selection […]Sort text cells alphabetically from two columns using excel array formula

Table of Contents Sort text from two columns combined (array formula) Sort text from multiple cell ranges combined (user defined […]### 2 Responses to “Sort cell values in corresponding columns”

### Leave a Reply

**How to add a formula to your comment:**

<code>your formula</code>

Remember to convert less than and larger than signs to html character entities before you post your comment.

**How to add VBA code to your comment:**

[vb 1="vbnet" language=","]

VBA code

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org

Add picture link to comment.

**Contact Oscar**

You can contact me through this webpage

I actually would like to find a way on how to vlookup the two rows using excel vlookup. I'de like to generate the Time in and time out and log date in one table with using theire ID Number.

hope you can help me>

robe gucilatar,

Read this post:

https://www.get-digital-help.com/2012/10/31/use-multiple-conditions-in-vlookup/#dates