Hi Jaine,
Can you describe in English what you are hoping the formula would do? That would help us give you better direction than attempting to decipher your formula above.
Sajan - this is the same thing as I am trying to do in the extract I posted on another thread. I was trying to have a go myself!
All - I have a number of cells that 'could' contain data; this would be based on what benefit they were awarded. At the moment the financial impact of the benefit is being calculated manually (!!! madness with the capabilities of Excel). So, in English, this is what I "thought" I'd written:
If M4 is blank, move onto N4 - if this is blank move onto O4 and so on until the end of the string. When there is an entry in one (possible max of two) of the cells (M4:Q4) I want Excel to lookup the value in a table on another sheet and calculate the value of the benefit. Ideally, I would also like it to calculate the overall value based on the number of years the benefit has been awarded for.
I thought I was pretty good at excel until I started getting Chandoo's bulletins: I know nothing!
This part of Xiq's cleaned version of your formula:
LEN($M4&$N4&$O4&$P4)>0
or this mine an array formula:
MAX(LEN(M4:Q4))>0
evaluate to true if anything is entered in that range, so I'd give a try to Xiq full normal (non-array) formula ot to my array formula:
=IF(MAX(LEN(M4:Q4))>0>0,VLOOKUP(A2,Sheet3!$A$4:$C$21,3,FALSE),"")
both should work.
2 things:
a) If you have to deal with a short number of cells, go with Xiq; otherwise go with the array formula
b) Remember that array formulas should be entered with Ctrl-Shift-Enter instead of just Enter.