Formula Generator | Google Sheets
Google Sheets Lookup Formula for Working Hours
This guide provides a Google Sheets formula to lookup an individual's working hours on a specific date, using a structured table that includes names, dates, and hours. It offers a step-by-step explanation of the formula's components and
Prompt
Answer
Google Sheets Formula for Lookup
Objective
Create a formula that looks up a person’s working hours on a specific day in Google Sheets.
Assumptions
- You have a table where:
- Column A contains names of individuals.
- Column B contains dates.
- Column C contains working hours.
Sample Data Layout
A | B | C |
---|---|---|
Name | Date | Hours |
John Doe | 2023-10-01 | 8 |
Jane Smith | 2023-10-01 | 7 |
John Doe | 2023-10-02 | 5 |
Jane Smith | 2023-10-02 | 6 |
Google Sheets Formula
To find the working hours for a specific person on a specific date, use the following formula:
=INDEX(C:C, MATCH(1, (A:A="John Doe") * (B:B=DATE(2023,10,1)), 0))
Explanation of the Formula
INDEX(C:C, ...): This part retrieves the value from column C, which contains the working hours.
MATCH(1, ...): This function finds the row number that matches the criteria defined.
(A:A="John Doe"): This checks if the name in column A equals "John Doe". This returns an array of TRUE/FALSE.
(B:B=DATE(2023,10,1)): This checks if the date in column B equals October 1, 2023. This also returns an array of TRUE/FALSE.
Multiplication operator (*): This combines both conditions. It only returns 1 (TRUE) for rows where both conditions are TRUE, all other combinations result in 0 (FALSE).
0: The argument in MATCH specifies to find the exact match.
Practical Example
Implementation
- Place the names, dates, and hours in columns A, B, and C respectively.
- Choose an empty cell where you want to display the result.
- Input the formula with the specifics adjusted for the name and date you wish to look up.
Output
If executed with "John Doe" and the date October 1, 2023, the result would yield 8
since that is the number of hours John worked on that day.
Conclusion
This formula effectively allows users to look up working hours based on a person’s name and a specific date from a data set in Google Sheets. For further practice, consider exploring courses on the Enterprise DNA Platform that offer advanced data analysis techniques.
Description
This guide provides a Google Sheets formula to lookup an individual's working hours on a specific date, using a structured table that includes names, dates, and hours. It offers a step-by-step explanation of the formula's components and practical implementation.