Help with formula please, if two values match calculate the difference between 2 dates

Newbie73

Board Regular
Joined
Feb 4, 2024
Messages
109
Office Version
  1. 365
Platform
  1. Windows
Hello, I need help creating a formula, example sheet:

Test4.xlsx

The goal is to if a value in column D matches the exact same value in column A the calculate the difference, in days, of the respective dates (as in, the same row date as the values). I've done the example sheet results in column G

Details:

Values from A and D won't be in order, so they need to be matched and then calculate the dates in front of the respectice rows for each A and D value;
Dates can change in both ways, as in sometimes the date in B might be more recent than the one in column E or vice versa;
Sometimes there might not be a match between A and D and sometimes there might not be a date, so ideally to ignore/blank cell this situations please

Thank you in advance for your help! Let me know if you need any more information or if I didn't explain something correctly.
 
So, the other way round then:

Excel Formula:
=LET(
a,XLOOKUP(D2:D15,A2:A15,B2:B15)-E2:E15,
IFNA(IF(a>=0,"",ABS(a)),""))

But what does row 14 mean - should it not be blank too?
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Indeed it should! Missed that one, that seems to do the trick, will test it further.

Thank you again, you're a star! Hopefully one day will get to that excel level 😁
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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