search for matching dates, then copy data when a match is found

RXND

New Member
Joined
Jan 26, 2024
Messages
5
Office Version
  1. 2019
Platform
  1. Windows
Hello Everyone have a problem that I’m trying to solve.

Id like to match dates from column c to column A, and copy the data from column D to Column B.

I have raw data with dates( C & D ) but are not in order, or skipping some dates. I basically need a way to search through the dates, and match them with the calendar days on column A, and then copy the matching info to column B.

Any help to point me in the right direction is greatly appreciated.

Thank you
 

Attachments

  • IMG_6646.jpeg
    IMG_6646.jpeg
    237.6 KB · Views: 5

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Maybe this will work.

Paste this in cell B1. Make sure to change the range to match the length of the ranges on your sheet.

VBA Code:
IFNA(XLOOKUP(A1,$C$1:$C$13,$D$1:$D$13),"")

It will return something like this:

1706298457625.png
 

Attachments

  • 1706298441952.png
    1706298441952.png
    11.9 KB · Views: 4
Upvote 1
Thank you so much. This was exactly what I was looking for.

Have a good weekend !
 
Upvote 0
Just noted you have Excel 2019, if you get an error when using that formula, please try this one(Again, please change the range to match what is on your sheet).

VBA Code:
=IFNA(VLOOKUP(A1,$C$1:$D$13,2,FALSE),"")

I hoe you have a good weekend as well.
 
Upvote 1
Solution
FYI there is no need for the ifna function as xlookup can handle that itself like
Excel Formula:
=XLOOKUP(A1,$C$1:$C$13,$D$1:$D$13,"")
 
Upvote 1
Maybe this will work.

Paste this in cell B1. Make sure to change the range to match the length of the ranges on your sheet.

VBA Code:
IFNA(XLOOKUP(A1,$C$1:$C$13,$D$1:$D$13),"")

It will return something like this:
 
Upvote 0
In that case what version of Excel are you using, as 2019 doesn't have xlookup?
oh Im using 2019. The result that you posted was the result that im looking for. How can I run something similar in the 2019 version?
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,977
Members
449,095
Latest member
Mr Hughes

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