z.B. sieht eine Formel im Moment so aus:
=SVERWEIS(WENN($AP2<'D:\[Kategorien.xls]Tabelle1'!$F$2;1;VERGLEICH($AP2;'D:\[Kategorien.xls]Tabelle1'!$F$1:$F$200;1));'D:\[Kategorien.xls]Tabelle1'!$E$1:$F$200;2;FALSCH)
Nun hätte ich daraus gerne eine ben. Funktion bei der ich nur noch das Datum ($AP2) eingeben muss.
Die Funktion mal ganz primitiv:
Public Function Datumskategorie(Datum)
Datumskategorie =SVERWEIS(WENN(Datum<'D:\[Kategorien.xls]Tabelle1'!$F$2;1;VERGLEICH(Datum;'D:\[Kategorien.xls]Tabelle1'!$F$1:$F$200;1));'D:\[Kategorien.xls]Tabelle1'!$E$1:$F$200;2;FALSCH)
End Function
Geht so natürlich nicht. Die Frage ist also wie funktioniert es richtig?
Danke