# Looking up by range of dates, returning sorted data

#### sactyr

##### New Member
Hi all, my first post here, hope someone can help me.

I have names of suppliers in column A, names of clients in column B, and dates of which the contracts are coming to end/expiring in column C. There are also other columns in this data but for they won't be needed for what I am about to do.

 A B C Supplier A Client A 1 May 2013 Supplier B Client B 1 April 2014 Supplier C Client C 1 Sept 2013

<tbody>
</tbody>

In another worksheet I need to sort the data (just need to return names of suppliers and clients - from column A and B), for which the contracts are expiring, separated by months. This however depends on today's date, up to two months. So if open the document on 27 March 2013 then I would like the data returned to be from the months of April (1 April 2013 - 30 April 2013) and May (1 May 2013 - 31 May 2013).

Is this possible? Cheers

### Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi sactyr,

Welcome to the forum.

With todays date in D1 and your example data in A1:C3

Enter this in E1 and pull down. =IF(C1-D1<60,A1&" "&B1,"")

With your example and this formula it Returns "Supplier A Client A"

I may have C1-D1 backwards, if so the do D1-C1 in the formula and pull down.

Regards,
Howard

Replies
9
Views
247
Replies
17
Views
488
Replies
0
Views
209
Replies
6
Views
426
Replies
0
Views
294

1,196,252
Messages
6,014,265
Members
441,809
Latest member
pawansher2002

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back