I have a database in Excel which consists of a couple of thousand rows or so which users need to sort, filter and manually amend regularly. I need to include a calculated value on each row based upon the results of a combined match,index,index formula as follows
=IFERROR(IF(ISBLANK(B2063),INDEX(SectorYield!$D$3:$N$5,MATCH(UniqueValues!F2063,SectorYield!$A$3:$A$5,0),MATCH(UniqueValues!D2063,SectorYield!$D$2:$M$2,1)),0),0)
The formula determines the value of the cell from a matrix held on another sheet. It all works perfectly until I use the Excel Filter/Sort function to re-order the database. The "UniqueValues!F2063" & "UniqueValues!D2063" (in this case) refer to the x and y values on the current row to be matched against the table elsewhere. BUT when the database is sorted the formulae are not modified to take account of the revised position of the row in the database and therefore the cell value reflects the x,y values for what is now in row 2063 instead of the x,y values of this row which has moved to say row 10 depending on the sort!
I hope this makes sense. I have obviously written the formula wrongly but I can't see how. Is there a way to use this kind of formula in a database or is it just a no no? If not possible, can anybody suggest a better way of handling it?
The problem is that the values in the table on the SectorYield sheet could change at any time as could the x,y values in the row on the UniqueValues database sheet but the cell in which the formula resides must always show the up to date and correct value automatically.
In short Help Please! I am stuck! Many thanks,
=IFERROR(IF(ISBLANK(B2063),INDEX(SectorYield!$D$3:$N$5,MATCH(UniqueValues!F2063,SectorYield!$A$3:$A$5,0),MATCH(UniqueValues!D2063,SectorYield!$D$2:$M$2,1)),0),0)
The formula determines the value of the cell from a matrix held on another sheet. It all works perfectly until I use the Excel Filter/Sort function to re-order the database. The "UniqueValues!F2063" & "UniqueValues!D2063" (in this case) refer to the x and y values on the current row to be matched against the table elsewhere. BUT when the database is sorted the formulae are not modified to take account of the revised position of the row in the database and therefore the cell value reflects the x,y values for what is now in row 2063 instead of the x,y values of this row which has moved to say row 10 depending on the sort!
I hope this makes sense. I have obviously written the formula wrongly but I can't see how. Is there a way to use this kind of formula in a database or is it just a no no? If not possible, can anybody suggest a better way of handling it?
The problem is that the values in the table on the SectorYield sheet could change at any time as could the x,y values in the row on the UniqueValues database sheet but the cell in which the formula resides must always show the up to date and correct value automatically.
In short Help Please! I am stuck! Many thanks,