ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
How to test if a date is between multiple ranges in excel
ฝัง
- เผยแพร่เมื่อ 11 เม.ย. 2023
- Flag data in excel:
If there are multiple start and end dates, how to find out if a date is within any of those ranges.
=IF(COUNTIFS($D$7:$D$9," less than ="&A2,$E$7:$E$9," greater than ="&A2) greater than 0,"Yes","No")
Thanks I was looking for a way to not write a big long formula this is great
Thanks, that was very clear and works well.
You are awesome🎉
Does this works on different years
COUNTIFS has been around since Excel 2010, but I'm not sure when Array formulas using [Ctrl][Shift][Enter] became available. Whenever that was, the array formula which works for Excel 365 and on as well as older versions using [Ctrl][Shift][Enter] is =COUNTIFS(C4:C6,"="&A2:A17). The advantage is there's no need to lock cell references, no need to copy down, and only one formula.
How to find in which range that date falls?
I found a way, if you give each date range an ID number, then do a count statement like this only using the start date: =COUNTIFS($T$2:$T$20,"