Search code examples
excelexcel-formulaexcel-2010

Checking condition from two columns and accordingly populate values from 3rd column in excel


Following table is given:-

person date sales
A 10/02/2020 10
A 11/02/2020 20
A 12/02/2020 30
B 13/02/2020 40
C 14/02/2020 50

on given dates we need to check sales corresponding each person as shown in the following table.

reqd output:-

date A B C
10/02/2020 10
11/02/2020 20
12/02/2020 30
13/02/2020 40
14/02/2020 50

I was able to get this output using pivot table but need to articulate the same output using formulas of excel.

I got this logic that excel would match the date and person an fetch the corresponding sales. But unable to implement this logic to find.There are more than 10000 rows so can't use if else straight away Need some logic which can be populated in all the rows.


Solution

  • As you are using Excel2010 then give a try below formula-

    =IFERROR(INDEX($C$2:$C$6,MATCH(G$1&$F2,$A$2:$A$6&$B$2:$B$6,0)),"")
    

    enter image description here