XLOOKUP & INT

Jamiek1

New Member
Joined
Sep 30, 2022
Messages
7
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi

I am trying to return a date using XLOOKUP which it does, however, the original date is shown as Date and Time 01/02/2023 12:40:58 and I want to remove the time without changing the format of the cell as when I then use a pivot on the returned date it will still show as date and time.

=XLOOKUP (J2,A:A,B:B,"",0)
How do I incorporate the INT on the returned data in the same formula as I don't want a new column of data.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I am a little confused, do you want to return and show only the date portion (but still have the time portion in the value) but not formatted as solely a date? Then display date and time in your pivot charts?

If you use INT in the match function you will strip out the time component.

Have you considered formatting the pivot table data as date/time?

It will help greatly if you can post a mini workbook with a sample of your data, the calculation, and how it is used in the pivot table? the xl2bb add in (link below) enables you to share the data with the forum. If there is sensitive or personal data, you can anonymize it.
 
Upvote 0
Apologies I should have explained this better.

Column A and J have unique ID's
Column B has Date and Time

I want to return just the date from Colum B into column K
 
Upvote 0
Okay, here are two different applications of the INT function. I don't know which is best from a performance perspective:
Book1
ABIJKL
1IDDate/TimeIDXLOOKUP INT(B:B)INT(XLOOKUP())
2PLH22-Feb-2023 10:05:07OEP10-Feb-2023 00:00:0010-Feb-2023 00:00:00
3SCV20-Mar-2023 08:07:15FTI17-Feb-2023 00:00:0017-Feb-2023 00:00:00
4OEP10-Feb-2023 09:13:38KLO08-Feb-2023 00:00:0008-Feb-2023 00:00:00
5FTI17-Feb-2023 04:56:26UHC08-Mar-2023 00:00:0008-Mar-2023 00:00:00
6KLO08-Feb-2023 22:38:33
7UHC08-Mar-2023 05:13:21
8DUE11-Feb-2023 06:59:54
9LCE04-Feb-2023 07:51:36
10ZFQ03-Mar-2023 02:33:19
11MUP10-Mar-2023 20:11:16
12SRW18-Mar-2023 12:29:55
13CRG17-Feb-2023 07:25:09
14NDP04-Feb-2023 20:33:46
15MMD21-Mar-2023 11:32:39
16ICQ18-Feb-2023 09:06:30
Sheet1
Cell Formulas
RangeFormula
K2:K5K2=XLOOKUP(J2,A:A,INT(B:B),"",0)
L2:L5L2=INT(XLOOKUP(J2,A:A,B:B,"",0))
 
Upvote 1
Solution
Perfect thanks very much.
Large data set and will check performance but option 1 appears to be good so far.
 
Upvote 0
My pleasure, happy to help.
I formatted the columns to show the entire time component, please format as your requirements dictate.

And welcome to the forum!
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

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