+ Reply to Thread
Results 1 to 14 of 14

Find a specific date within a table and return value is specific column in the same row

  1. #1
    Registered User
    Join Date
    03-15-2023
    Location
    California
    MS-Off Ver
    365
    Posts
    7

    Find a specific date within a table and return value is specific column in the same row

    Hello,

    I am trying to avoid multiple if, and statements in a project I am doing. What I have is a table of dates in C2:Q31. I am looking for a formula that would find a specified date within the table and return the date in column Q within the row the date is found. I tried VLookup and is only looking for the date in column C and not columns D through P. Any suggestions would be very much appreciated.

    Thank you!
    Attached Files Attached Files
    Last edited by NatalieCox; 03-15-2023 at 02:52 PM. Reason: Attaching Sample

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Find a specific date within a table and return value is specific column in the same ro

    you may need to post a sample file to better illustrate the requirement

    the below would return the first row (number) in which a given date (A1) is found in the range specified

    =AGGREGATE(15,6,ROW(2:31)/(C2:Q31=A1),1)

    however, you mention you want to find the date in Q so not entirely clear....at least, not to me

  3. #3
    Registered User
    Join Date
    03-15-2023
    Location
    California
    MS-Off Ver
    365
    Posts
    7

    Re: Find a specific date within a table and return value is specific column in the same ro

    Thank you for your reply. I have added a sample workbook. The ultimate goal is to add the pay date in column P based on the date in column C. The pay periods/pay dates are in the payroll periods sheet and the pay date is located in column Q of that sheet. I am working on an if, and formula, but it is taking forever as there is a typo I am trying to locate. I am convinced there is a better way. Any help is appreciated.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,216

    Re: Find a specific date within a table and return value is specific column in the same ro

    If I understand correctly ..

    try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by JohnTopley; 03-15-2023 at 04:38 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    03-15-2023
    Location
    California
    MS-Off Ver
    365
    Posts
    7

    Re: Find a specific date within a table and return value is specific column in the same ro

    Thank you for your reply. Unfortunately, this did not work.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,216

    Re: Find a specific date within a table and return value is specific column in the same ro

    Try

    =INDEX($AB$2:$AB$31,MATCH($C2,$Z$2:$Z$31,1))

    If this not correct then please add expected results to your file,
    Last edited by JohnTopley; 03-18-2023 at 04:10 AM.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Find a specific date within a table and return value is specific column in the same ro

    If I understand correctly try this in P2 and copy down until you get blanks. Although I am somewhat confused by the instructions for testing each date in Sample!Column C and the formula that was text entered in Sample!P2 that only tests the first date in Sample!Column C (ie.C2).

    This tests all those dates in column C.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Find a specific date within a table and return value is specific column in the same ro

    A cursory glance at both sheets shows a mix of US and UK formatting - is this intentional or is it just my locale messing up the sheets.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  9. #9
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,832

    Re: Find a specific date within a table and return value is specific column in the same ro

    Try this in P2 of "Sample" sheet:

    =INDEX(PayrollPeriods!$Q$2:$Q$31,XMATCH(C2,PayrollPeriods!$C$2:$C$31,-1))

    and copy down.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Find a specific date within a table and return value is specific column in the same ro

    This I found to calculate much faster (about 25% less time for the calculated range) than my previous formula in post #7. It takes advantage of the LAMBDA function(s) in Office 365. In P2 and copied down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    03-15-2023
    Location
    California
    MS-Off Ver
    365
    Posts
    7

    Re: Find a specific date within a table and return value is specific column in the same ro

    FlameRetired,

    That worked, thank you!

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Find a specific date within a table and return value is specific column in the same ro

    You are welcome. BTW: which of my two formulas are you referring to?

  13. #13
    Registered User
    Join Date
    03-15-2023
    Location
    California
    MS-Off Ver
    365
    Posts
    7

    Re: Find a specific date within a table and return value is specific column in the same ro

    This one: =IF(C2="","",INDEX(PayrollPeriods!$Q$2:$Q$31,MATCH(1,MMULT(--(C2=PayrollPeriods!$C$2:$P$31),TRANSPOSE(COLUMN($C$2:$P$31))^0),0)))

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Find a specific date within a table and return value is specific column in the same ro

    Thank you. Glad it helped. Thank you for the feedback and marking your thread Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Find a specific number in a large table of numbers and return where it is
    By Thomaswharper in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-16-2020, 01:20 PM
  2. [SOLVED] Find duplicate return specific column color
    By MaKo82 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-19-2019, 11:48 AM
  3. [SOLVED] Find the last specific value in a column and return the adjacent value
    By zeegerman in forum Excel General
    Replies: 4
    Last Post: 08-03-2015, 11:55 AM
  4. [SOLVED] Find specific value in table and return header row and header column value
    By nelwan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2013, 01:35 AM
  5. [SOLVED] Return a specific value for a date from a table of date ranges
    By Brit in forum Excel General
    Replies: 3
    Last Post: 07-11-2012, 05:53 AM
  6. Find specific text in column and return cell value from its immediate right
    By cneff in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-08-2012, 07:59 AM
  7. Replies: 1
    Last Post: 01-15-2010, 05:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1