A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hi Kala,
Welcome to the Microsoft Q&A forum.
Based on your description, I understand that you would like to:
1/ Retrieve the Hours value from the source data worksheet and return it to the target worksheet.
2/ Perform the lookup based on two conditions at the same time:
- Extract the numeric code from the Position column, then standardize the code and match it against Timecard Work Department.
- Concatenate Payroll Company Code with File Number, then match the result against Alt. ID.
3/ When both conditions are met, Excel will return the corresponding Hours value.
4/ Perform the entire process using a single XLOOKUP or array formula, without creating any helper columns or changing the original data structure.
In my test environment, I used the following formula:
=@XLOOKUP(1,('Source Data'!R2C2:R1000C2="000"&LEFT(RC[-3],FIND("-",RC[-3])-1))*('Source Data'!R2C1:R1000C1&'Source Data'!R2C3:R1000C3=RC[-1]),'Source Data'!R2C4:R1000C4,"Not found")
If the conditions do not match, the formula will return "Not found".
I hope this information is helpful.
If you have any questions or need further assistance, please feel free to share them in the comments on this post so I can continue to support you.
I look forward to continuing the conversation.
If the answer is helpful, please click "Yes" and kindly upvote it.
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.