A fond hello to all the wonderful gurus here. And, of course, an Excel question.
I am trying to create an array UDF that will return results in a range of selected cells. The UDF uses four inputs: a constant value, a constant start date, a constant end date , and a range of quarter dates that extend a number of years along a row. The task is to compare the start date and end date with the first quarter in the quarter range and with the second quarter in the quarter range to determine if the start and end dates occur within the quarter. Depending on the particular result, X can be anywhere from 0 to 1 or some fraction in between. The contant value gets multiplied by X and that is the answer.
I know my logic works because I created a UDF that works if I enter it in one cell and then drag to fill the other cells. It returns valid results.
What I’m trying to do now is to create an array UDF where I can select the output range, enter the UDF, press CTRL+SHIFT+ENTER and get the various results along the selected range.
I have attached a sample workbook to show what I mean.
I just can’t figure out what I’m doing wrong.