B
Boris
I have come across a somewhat frustrating problem in Excel 2002 when using if
statements and then an evaluation which uses indirect addressing and match
statements to perform an evaluation (subject to some preconditions in the if
statement). My evaluation statement
[MAX(E6:INDIRECT(ADDRESS(ROW(B6)-1+MATCH(B6+L$4/24-($B$7-Starttime),(B6:indirect(ADDRESS(ROW(B6)+L$4/(($B$7-Starttime)*24),COLUMN(B6)))),0),COLUMN(E6))))]
works fine on its own, and works equally well inside a single if but, as soon
as I put two or more nested if statements before the evaluation, Excel sates
that there is an error in the formula and will only accept the formula once I
have replaced the indirect(address()) statements in the match statement with
fixed addresses (which sort of defeats the whole point).
I am using this rather convoluted formula as I have a real world data set
where occasionally data is completely missing and sometimes individual data
points are blank but I need to perform an evaluation over a fixed time span -
the indirect addressing therefore defines the range I need to act upon, which
varies, as I say, over a large data set (perhaps 34000 rows).
What I really cannot understand is why, when my evaluation statement works
fine, and when it works fine as the final part of a simple if, what Excel
might be objecting to when I put it as the final part of a 3 level deep
nested if... I have checked and quadruple checked that the syntax is correct
and that all brackets are matched and correct, etc, but cannot find any error
in the formula and cannot find a way of getting Excel to accept my formula
entry.
For info, her is a simple version that works followed by a simple version
that does not - although they nominally do exactly the same thing!
1 works
[=IF(OR(E6="",E101=""),"",(MAX(E6:INDIRECT(ADDRESS(ROW(B6)-1+MATCH(B6+L$4/24-($B$7-Starttime),B6:INDIRECT(ADDRESS(ROW(B6)+L$4/(($B$7-Starttime)*24),COLUMN(B6))),0),COLUMN(E6))))))]
2 doesn't work
[=IF(E6="","",if(E101="","",MAX(E6:INDIRECT(ADDRESS(ROW(B6)-1+MATCH(B6+L$4/24-($B$7-Starttime),B6:INDIRECT(ADDRESS(ROW(B6)+L$4/(($B$7-Starttime)*24),COLUMN(B6))),0),COLUMN(E6))))))]
Any help or advice would be greatly appreciated.
Many thanks and best wishes
statements and then an evaluation which uses indirect addressing and match
statements to perform an evaluation (subject to some preconditions in the if
statement). My evaluation statement
[MAX(E6:INDIRECT(ADDRESS(ROW(B6)-1+MATCH(B6+L$4/24-($B$7-Starttime),(B6:indirect(ADDRESS(ROW(B6)+L$4/(($B$7-Starttime)*24),COLUMN(B6)))),0),COLUMN(E6))))]
works fine on its own, and works equally well inside a single if but, as soon
as I put two or more nested if statements before the evaluation, Excel sates
that there is an error in the formula and will only accept the formula once I
have replaced the indirect(address()) statements in the match statement with
fixed addresses (which sort of defeats the whole point).
I am using this rather convoluted formula as I have a real world data set
where occasionally data is completely missing and sometimes individual data
points are blank but I need to perform an evaluation over a fixed time span -
the indirect addressing therefore defines the range I need to act upon, which
varies, as I say, over a large data set (perhaps 34000 rows).
What I really cannot understand is why, when my evaluation statement works
fine, and when it works fine as the final part of a simple if, what Excel
might be objecting to when I put it as the final part of a 3 level deep
nested if... I have checked and quadruple checked that the syntax is correct
and that all brackets are matched and correct, etc, but cannot find any error
in the formula and cannot find a way of getting Excel to accept my formula
entry.
For info, her is a simple version that works followed by a simple version
that does not - although they nominally do exactly the same thing!
1 works
[=IF(OR(E6="",E101=""),"",(MAX(E6:INDIRECT(ADDRESS(ROW(B6)-1+MATCH(B6+L$4/24-($B$7-Starttime),B6:INDIRECT(ADDRESS(ROW(B6)+L$4/(($B$7-Starttime)*24),COLUMN(B6))),0),COLUMN(E6))))))]
2 doesn't work
[=IF(E6="","",if(E101="","",MAX(E6:INDIRECT(ADDRESS(ROW(B6)-1+MATCH(B6+L$4/24-($B$7-Starttime),B6:INDIRECT(ADDRESS(ROW(B6)+L$4/(($B$7-Starttime)*24),COLUMN(B6))),0),COLUMN(E6))))))]
Any help or advice would be greatly appreciated.
Many thanks and best wishes