## Sort cell values in corresponding columns

*Article last 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**

Table of Contents Sort a column using array formula Two columns sorting by the second column Sort alphanumeric values I […]

Sort dates within a date range

Question: I have a list of unsorted dates. I want to extract records between two dates and I want the […]

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 values in parallel (array formula)

Table of contents How to sort a table by Column 1 and then by Column 2 (array formula) How to […]

Lookup and return multiple values sorted in a custom order

Pat asks: Hi Oscar, Thanks for creating such a helpful website and I've a question if I would like to […]

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 […]

How to sort cells filtered by two dates

Question: I have a list containg dates and values. How do I sort values between two specific dates? Answer: Yellow […]

Denisa asks: I have a problem and i cant figure it out, even if i'm seraching for 2 days. I […]

Sort values in an Excel table [VBA]

awall asks: Hey, can you do the opposite of this - not random order but this is my situation. I […]

Sort values in a cell using a custom delimiter [VBA]

The following macro lets you select a cell range and a delimiting character. The macro sorts the values in each […]

### 2 Responses to “Sort cell values in corresponding columns”

### Leave a Reply

### How to comment

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

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

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

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

Put your VBA code here.

[/vb]

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

Upload picture to postimage.org or imgur

Use the img tag, like this: <img src="Insert pic link here">

**Contact Oscar**

You can contact me through this contact form

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