Return Number Based on Date

dunmore83

Well-known Member
Joined
Aug 24, 2011
Messages
540
Hi,

In my 1st spreadsheet named ABC I have unique numbers (no duplicates) in Column B

In my 2nd spreadsheet named MOP I have dates in column F & numbers in Column G. In column B are the values from Column B in column B in the ABC spreadsheet (with duplicates).

In my 1st spreadsheet ABC I need a formula to go into column F that will return the 1st date found in the MOP spreadsheet in Column F based on the Lookup Value in Column B

I then need a formula to go in the ABC spreadsheet in column J that will return the next newest date which occurs after the one returned from the formula in Column F. I then need to repeat this formula by continuing to find the next newest date in column F of MOP.

Hope it makes sense!

Any helpers ??
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Could you post image/screenshot/XL2BB to display data in the worksheet?
 
Upvote 0
Just a note:
You said:
"In my 1st spreadsheet named ABC"

The term "spreadsheet"
Was used prior to about 1980 to refer to what we now call a "Workbook"
Today Excel uses the terms "Workbook" and "Worksheet"
So I assume you mean Worksheet named "ABC"

Excel can have several "Worksheets" in a "Workbook"
 
Upvote 0
Sorry for the incorrect use of the term spreadsheet. Yes please replace the term spreadsheet with Worksheet.
 
Upvote 0
Screenshots below. Thanks
 

Attachments

  • excel-screenshot-2-reduced.jpg
    excel-screenshot-2-reduced.jpg
    110.6 KB · Views: 9
  • excel-screenshot-1-reduced.jpg
    excel-screenshot-1-reduced.jpg
    138 KB · Views: 8
Upvote 0
there are too much data to input manually to test
can you try to post mini sheet via XL2BB tool, follow link instruction in #2?
 
Upvote 0
In my 1st spreadsheet ABC I need a formula to go into column F that will return the 1st date found in the MOP spreadsheet in Column F based on the Lookup Value in Column B
What do you mean by the 'first' date found?
- The one closest to the top of the worksheet column?
- The earliest date?
- The latest date?
- Something else?

The sample dates in column G of MOP are all identical (as far as I can see). Are the actual dates in that column sorted? If so, earliest dates at top of column or latest dates at top of column?
 
Upvote 0
Thanks for your reply. The sample dates in column F of MOP are a number of different dates. It just shows 01-Feb-22 in the screenshot. I do not plan to sort column F.

I need a formula in Column F of ABC to return the earliest date for that VID (column B). Then in column J the next date found after the date in Column F for that VID.
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Since you haven't given us any sample data that we can copy (as suggested by bebo, check out XL2BB for next time) this is my sample MOP sheet

dunmore83.xlsm
BF
1
21235207-Feb-22
31234704-Mar-22
41235019-Feb-22
51235118-Jan-22
61234511-Feb-22
71234629-Mar-22
81234820-Feb-22
91234922-Jan-22
101235219-Feb-22
111235322-Feb-22
121234917-Mar-22
131234821-Mar-22
141234806-Mar-22
151234629-Jan-22
161235329-Jan-22
171235115-Jan-22
181234711-Feb-22
191234919-Jan-22
201235316-Feb-22
211235114-Mar-22
221234504-Feb-22
231234718-Jan-22
241234503-Feb-22
251235007-Jan-22
261235025-Mar-22
271234625-Jan-22
281235219-Jan-22
MOP


Then see if these do what you want.

Cell Formulas
RangeFormula
F2:F10F2=AGGREGATE(15,6,MOP!F$2:F$100/(MOP!B$2:B$100=B2),1)
J2:J10J2=AGGREGATE(15,6,MOP!F$2:F$100/(MOP!B$2:B$100=B2),2)
N2:N10N2=AGGREGATE(15,6,MOP!F$2:F$100/(MOP!B$2:B$100=B2),3)
 
Upvote 0
I will try XL2BB next time.

Excellent. That works except in the 3rd column where this no 3rd date yet it returns #NUM! Can we adjust the formula so it returns a blank value if no 3rd date is found ?
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top