Hi all,
I have a slight problem.
In the file i have attached there is a list of values in column A which spreads from A2:A62. Those are fixed values. Cell C1 is a cell to input a value for comparison, and C2 cell contains formula that determines value closest to it. I downloaded a file containing the formula i needed which works fine. The formula is:
=INDEX(A2:A62;MATCH(MIN(ABS(A2:A62-C1));ABS(A2:A62-C1);0))
I need to add IF clause to get closest higher value instead of closest value which wouldn't be a problem if formula worked after i try to edit it. Even if i change nothing or type the formula in from scratch it still refuses to work.
I tried to use evaluate formula on original formula and the formula i type in (which look the same). What i got is in case of original C2 formula starting value is value of C1 cell
=INDEX(A2:A62;MATCH(MIN(ABS(A2:A62-C1));ABS(A2:A62-C1);0))
while in edited formula (just pressed enter in formula input area without changing anything) starting value is A2:A62 array
=INDEX(A2:A62;MATCH(MIN(ABS(A2:A62-C1));ABS(A2:A62-C1);0))
which i think is causing my problem
any help or link to a topic that could help me would be great
THX in advance
P.S.
When i try to open attached file in openoffice calc i get:
504 Parameter list error Function parameter is not valid, for example, text instead of a number, or a domain reference instead of a cell reference.
P.P.S.
SOLVED: just used VLOOKUP instead like this
=VLOOKUP(C1;A2:A62;1;1)
or in case of closest higher it goes like:
=IF(C1<A2;A2;IF(VLOOKUP(C1; A2:A62; 1)>=C1;VLOOKUP(C1; A2:A62; 1);INDEX(A2:A62;MATCH(VLOOKUP(C1; A2:A62; 1);A2:A62)+1)))
Bookmarks