I need a function in Excel based on the following criteria: column A contains employee…
- User
I need a function in Excel based on the following criteria: column A contains employee numbers, column B contains worked time for each day of the month, column C contains date of the time in column B. For an example, in column A an employee number appears several times because that employee has worked several days that month. I need a function in Excel to summerize the time in column B for each employee.
- Assistant
You can use the SUMIF function in Excel to summarize the time in column B for each employee in column A.
The syntax of the SUMIF function is: =SUMIF(range, criteria, [sum_range])
In your case, you can use the following formula in a separate cell to summarize the time for each employee:
=SUMIF(A:A, "employee number", B:B)
Replace "employee number" with the actual employee number and adjust the range accordingly. This formula will sum all the values in column B that match the criteria in column A for the specified employee.
You can then copy and paste this formula for each of the employees to get the time worked for each one.
- User
Let's set up different spread sheets in Excel, where the information with all the data I just mentioned is in Sheet 1 and in Sheet 2 on the other hand all the employee numbers of Sheet 1 is in Sheet 2 but removed all the duplicates. In Sheet 1 Column A is all the employee numbers as in the previous sentence and in Column B I need a function that first references the Column A in Sheet 1 and after that looks for the data in Sheet 1 to summerize all the worked time of that employee number.
- Assistant
You can use a combination of the SUMIF and UNIQUE functions in Excel to summarize the worked time data for each unique employee number in a separate sheet.
To start, in Sheet 2, you can use the following formula in cell A2 to extract the unique employee numbers from Sheet 1:
=UNIQUE(Sheet1!A:A)
This will create a list of all unique employee numbers from column A in Sheet 1 in column A of Sheet 2.
Then, in column B of Sheet 2, you can use the following formula in cell B2 to summarize the worked time data for each employee number:
=SUMIF(Sheet1!A:A, A2, Sheet1!B:B)
This formula uses the SUMIF function to sum all the values in column B of Sheet 1 that match the employee number in cell A2 of Sheet 2. The range A:A in Sheet1 is the column with employee numbers and range B:B represents the worked time for the employee.
You can then copy and paste this formula for each unique employee number in column A of Sheet 2 to summarize the worked time for each employee.