79534474

Date: 2025-03-25 17:51:41
Score: 1
Natty:
Report link

You can do it with this formula:
=AVERAGE(INDEX(TableSalaries,,MATCH("Employee Name1",TableSalaries[#Headers])))

where TableSalaries is the name of the table from your second attachment.

When you put it in your table, you will change constant with reference to a cell with your Employee name for which you want to display the average salary, for example:
=AVERAGE(INDEX(TableSalaries,,MATCH([@[Employee Name]],TableSalaries[#Headers])))

Explanation:
- MATCH([@[Employee Name]],TableSalaries[#Headers]) is retrieving the column number in which your employee name is present
TableSalaries[#Headers] is a list of all the strings in the header of TableSalaries table
MATCH is returning index of searched element in the list

- INDEX(TableSalaries,,MATCH([@[Employee Name]],TableSalaries[#Headers])) is returning all the values from column by number, without header of course.
INDEX(array,row_number,column_number)

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Vlado Bošnjaković