AW: Hilfe bei Formel
15.12.2022 11:53:01
Hans
Hallo Forum,
als Vorbereitung auf vor der Tür stehende KI-Zeiten die Antwort auf die von Micha gestellte Frage bei ChatGTP (die KI ist im Übrigen für VBA-Fragen zu empfehlen):
------- schnipp --------
In the area A1:A200 there are different date entries (also several times the day), in the area B1:B200 there is the category "A" or "B"
I need a formula that gives me the number of different days for category "A" and "B".To get the number of different days for category "A" and "B" in Excel, you can use the following formula:
Copy code
=SUM(IF(FREQUENCY(MATCH(A1:A200,A1:A200,0),MATCH(A1:A200,A1:A200,0))>0,1))
This formula uses the FREQUENCY and MATCH functions to identify the different dates in the range A1:A200, and then uses the IF and SUM functions to count the number of different days.
To get the number of different days for category "A" separately, you can use the following formula:
Copy code
=SUM(IF(FREQUENCY(MATCH(A1:A200,A1:A200,0),MATCH(A1:A200,A1:A200,0))>0,(B1:B200="A")))
This formula uses the same approach as the previous formula, but it also uses the B1:B200 range to only count the different days for category "A". You can use a similar formula to get the number of different days for category "B".
Note that these formulas assume that the dates in the A1:A200 range are formatted as dates in Excel. If the dates are not formatted as dates, the formulas may not work as expected.
------- schnapp -------
Gruß hans