Copy data from cells on info sheet to cells on data sheet based on date.

CASEY BRYANT 0 Reputation points
2025-11-28T19:21:07.5166667+00:00

20251128_141429.jpgSo, I have cycle counts on certain departments that need to be done on a weekly rotating schedule(52 weeks). I want to be able to type in "week 44" or an actual date would work, for example...and have it fill 5 rows on the same sheet with the departments that need to be counted that week. Example: I type "week 48" or "11/23/35"(first day of week 48) on my main document. I want to to then pull from a pre filled info sheet with every week and/or start date of that week. I hope this makes sense. I attached a picture of the main data sheet.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Hendrix-C 8,560 Reputation points Microsoft External Staff Moderator
    2025-11-28T22:31:21.5266667+00:00

    Hi @CASEY BRYANT,

    Thank you for posting your question in the Microsoft Q&A forum.

    According to your request, you want to type week number or date value, then it will pull from the info sheet the data of start date - end date and the list of departments need to be counted in that week.

    I suggest you can try following this guidance to see if this would help resolve your concern:

    • In my Excel worksheet, I've created a test info sheet as below

    User's image

    • In the Main sheet, I will have a set up like this: cell A2 is used for inserting week number/date value, cell B2 for normalized week.

    User's image

    • In cell B2, I will use this formula:
    =LET(input,A2, wk_from_date, MOD(WEEKNUM(input,1)-1,52)+1, wk_from_number, MOD(INT(input)-1,52)+1, weekNum, IF(ISNUMBER(input), IF(input>40000, wk_from_date, wk_from_number), wk_from_number), startDate, INDEX(Info!$B$2:$B$54, MATCH(weekNum, Info!$A$2:$A$54,0)), "Week " & weekNum & "  " & TEXT(startDate,"mm/dd/yy") & " - " & TEXT(startDate+6,"mm/dd/yy"))
    
    • Then if I input the week number or random date value in cell A2, Excel will refer to data in the Info sheet and export the date according to the input data.
    • Please note that if you input general number (e.g 48) but cell A2 shows the value as date, it means the cell is stuck as Date formatting and you will need to change it back to General. However, the formula in cell B2 still works well.

    User's image

    • To export the departments, in cell A6, use this formula:
    =LET(input,$A$2,week,IF(input>40000,WEEKNUM(input,21),input), TRANSPOSE(XLOOKUP(week, Info!$A$2:$A$54, Info!$C$2:$G$54, "No match")))
    

    User's image

    Important note: The formulas use cells and data ranges refer to the structure of my testing worksheet. You need to change them based on your Excel file structure to make sure the formulas work properly.

    You can try the formulas and let me know if it works for you. If not, we can work together to resolve this.    

    Thank you for your patience and your understanding. If you have any questions or need further assistance, please feel free to share them in the comments so I can continue to support you. 

    I look forward to your response.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. CASEY BRYANT 0 Reputation points
    2025-12-11T17:46:27.82+00:00

    So, I ended up using xlookup, but I got it to work! Your idea did help me figure it out, so thank you!


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.