If there are missing values you want to ignore you need the na.rm = TRUE
library(tidyverse)
iris %>%
expand_grid(tibble(Min = seq(5, 7, .1), Max = Min + 0.1)) %>%
group_by(Min, Max) %>%
summarize(Sepal.Length.Count = sum((Sepal.Length > Min) & (Sepal.Length <= Max), na.rm = TRUE),
.groups = "drop")