The formula you gave returns "92" no matter what the date it is. That's not
going to work if the number of days in the quarter is 90 or 91. I have the
following formula that works,for my purposes, except when the current date
falls in the current quarter.
=IF(MID(E$1,8,1)="Q",VLOOKUP(E$3,$A$34:$B$38,2,FALSE),IF(MID(E$1,8,5)="TOTAL",(E$4-$D$4),DAY(E$4)))
This formula can be put into the file I posted on the file hosting site and
copied across. You'll see the NA for the column with FY2010.Q2 in H2.
The vlookup table looks like this:
2009.SEP.30 92
2009.DEC.31 92
2010.MAR.31 90
2010.JUN.30 91
2010.JUN.30 365
The problem arises with the current date. Since the vlookup doesn't have
every date possible, then I get an NA in the result for the current quarter.
Look at the file I posted again. As the current date changes, the current
quarter will need to show the correct number of days that have occurred thus
far in the current quarter. After the current quarter is over, the vlookup
works perfectly.
This is a complicated one!!