PaulFogel123
Member
I use hlookup formulas in my forecasting program to find dates from a data worksheet located on another tab. The formula references the proper month (the lookup value) and finds the right data from the data worksheet. Here is one such formula, simplified a bit:
=IF((HLOOKUP(CA4,Historical_Data,96)=FALSE),500,HLOOKUP(CA4,Historical_Data,32))
It looks for a test on row 96 in the database, and if true, returns a value from row 32 in the database. So far, so good. But if I add rows to my database to add new fields, the formula still looks for rows 96 and 32.
One solution is to use ROW('Historical_Data'!A96) and ROW('Historical_Data'!A32) for row_index_num in the above hlookup formulas. That way, a row inserted in the database will cause the row references to change too. But, is there a better or more elegant way to do this? Is MATCH/INDEX a better way to go?
=IF((HLOOKUP(CA4,Historical_Data,96)=FALSE),500,HLOOKUP(CA4,Historical_Data,32))
It looks for a test on row 96 in the database, and if true, returns a value from row 32 in the database. So far, so good. But if I add rows to my database to add new fields, the formula still looks for rows 96 and 32.
One solution is to use ROW('Historical_Data'!A96) and ROW('Historical_Data'!A32) for row_index_num in the above hlookup formulas. That way, a row inserted in the database will cause the row references to change too. But, is there a better or more elegant way to do this? Is MATCH/INDEX a better way to go?