
Originally Posted by
PeterO'Connor
I need to find the closest match given that some cells are blank or have " ". This has caused error values to come back regardless of whether I use the suggested countif function as a workaround.
I'm afraid I don't understand Peter.
The suggested Array validates on an ISNUMBER basis so whether your data set includes spaces or blanks amongst the numerics is irrelevant - they're simply ignored.
The pre-emptive COUNT test was merely to demonstrate that you can limit the times the suggested Array is invoked by validating as to whether or not any numerics exist in the range to start with - if not there's no need to validate, eg:
B4:
=IF(COUNT($E4:$O4),INDEX($E4:$O4,MATCH(MIN(IF(ISNUMBER($E4:$O4),ABS($E4:$O4-$A4))),IF(ISNUMBER($E4:$O4),ABS($E4:$O4-$A4),""),0)),"")
confirmed with CTRL + SHIFT + ENTER
copied down
I'm afraid at this point I think you need to post a sample which demonstrates the above returning erroneous results.
Bookmarks