I have two excel files.
First excel file contains the Person Name and Total Days Present column Ex.
PersonName TotalDays
xyz
ab
I would suggest a different approach.
If I interpret the question correctly:
The approach I would use is to use the COUNTIF (or if you hvae Excel 2007 or later COUNTIFS)
Assume
Solution for Excel 2007 or 2010
=COUNTIFS(file2.xlsx!StatusData[Name],[Name],file2.xlsx!StatusData[Status],StatusReport[[#Headers],[Present]]) =COUNTIFS(file2.xlsx!StatusData[Name],[Name],file2.xlsx!StatusData[Status],StatusReport[[#Headers],[Absent]])Solution for Excel 2003
Add an extra column D to file2 StatusData table (call it Code)
=Sheet1!$A2&"_"&Sheet1!$C2
file1 cell B2
=COUNTIF([file2.xls]Sheet1!$D:$D,Sheet2!$A2&"_"&Sheet2!$B$1)
=COUNTIF([file2.xls]Sheet1!$D:$D,Sheet2!$A2&"_"&Sheet2!$C$1) Note: while these formula give the same result the COUNTIFS + Table references version in 2010 if so much faster its not funny (my test on about 300,000 rows updates in a few seconds).