Pular para o conteúdo
GridBelt
  • Teste de Excel
  • Prática
  • Programas
  • Preços
Entrar
Começar o teste gratuito
  • Teste de Excel
  • Prática
  • Programas
  • Preços
EntrarCriar conta
Começar o teste gratuito
GridBelt

Pratique Excel no seu navegador.

Teste de Excel

  • Nível 1: Iniciante
  • Nível 2: Intermediário
  • Nível 3: Avançado
  • Teste de Excel em 7 dias
  • Ranking
  • Teste de Excel para entrevista
  • Avaliação de Excel da Indeed

Prática

  • Todos os exercícios
  • Programas
  • Para iniciantes

Guias

  • Fórmulas do Excel
  • Atalhos do Excel

Empresa

  • Sobre nós
  • Preços
  • Como corrigimos

© GridBelt. Todos os direitos reservados.

  • Política de Privacidade
  • Termos de Uso
  • Política de Reembolso

Excel é uma marca comercial da Microsoft Corporation. Indeed, TestGorilla, SHL e outras marcas pertencem aos seus respectivos proprietários. O GridBelt é um site de prática independente e não tem afiliação com Microsoft, TestGorilla, SHL ou Indeed, nem é endossado ou patrocinado por eles.

  1. Prática
  2. /
  3. COUNTIF and COUNTIFS

COUNTIFS practice: count orders between two dates in 300 rows

  • Intermediário
  • ~6 min
  • COUNTIF and COUNTIFS

Enunciado em inglês

The order log holds 300 orders from July to October 2026 with the order date in column B. The monthly report asks how many orders fall inside a reporting period whose start and end dates are typed into H2 and H3 — August at the moment, but the same sheet is reused every month. Count the orders from the start date to the end date, both days included, with a formula that reads the two date cells.

O que você precisa fazer

  1. 1Click H4. The order dates are in B2:B301; the period starts on the date in H2 and ends on the date in H3.
  2. 2A date condition in COUNTIFS is text joined to a cell: ">="&H2 means "on or after the date in H2" and "<="&H3 means "on or before the date in H3". Each condition needs its own copy of the date range.
  3. 3Write COUNTIFS with the two pairs — B2:B301 with ">="&H2, then B2:B301 with "<="&H3 — and press Enter.
  4. 4Change H2 to 2026-08-15: the count must fall; set it back and click Check (Ctrl+Enter / ⌘+Return).

Células de resposta

Correção

Digite sua fórmula na grade, pressione Enter e depois clique em Verificar. Avaliamos o valor de cada célula de resposta e a fórmula por trás dele.

Tarefas

  1. Não verificadoIn H4, count the orders whose date in B2:B301 is between the start date in H2 and the end date in H3 (both inclusive), using COUNTIFS with the two date cells as criteria.

Recomendamos um computador para as tarefas de planilha. A planilha rola dentro desta caixa.

StartInsertFormulasDataView
A1fxPreparando sua pasta de trabalho…
A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1

Digite sua fórmula na planilha e depois verifique.

Sobre este exercício

Um conjunto de dados de 300 linhas em uma planilha, uma célula de resposta, cerca de 6 minutos. Corrigido no seu navegador: o valor e a fórmula por trás dele, com feedback que mostra o que corrigir.

Como resolver

  • H4=COUNTIFS(B2:B301,">="&H2,B2:B301,"<="&H3)

Dates are numbers in a spreadsheet, so "between two dates" is two numeric conditions on the same column: at least the start date and at most the end date. COUNTIFS applies both at once — each pair names the date column B2:B301 and a criterion built as an operator in quotes joined to the date cell with &, such as ">="&H2. Because the formula reads H2 and H3, next month's report only needs two new dates typed in, not a new formula.

Pitfall 1: writing ">=H2" inside the quotes makes the criterion the literal text ">=H2", which matches nothing — the & is what inserts the date's value, producing ">=46235" under the hood. Pitfall 2: ">" and "<" exclude the boundary days; period reports almost always mean inclusive, so use >= and <= — the grader has orders on both boundary dates. Pitfall 3: when the date column contains timestamps (with hours), "<="&H3 stops at midnight at the start of the end day; use "<"&(H3+1) to include the whole day. Pitfall 4: text that looks like a date ("2026-08-01" imported as text) is not a number and is never counted — convert it with DATEVALUE or Text to Columns first. Alternatives: SUMPRODUCT((B2:B301>=H2)*(B2:B301<=H3)) avoids the string-building and is handy inside bigger formulas; COUNTIF(B2:B301,">="&H2)-COUNTIF(B2:B301,">"&H3) subtracts the orders after the period; in Excel 365, ROWS(FILTER(B2:B301,(B2:B301>=H2)*(B2:B301<=H3))) lists and counts at once.

Outras formas que funcionam

  • =SUMPRODUCT((B2:B301>=H2)*(B2:B301<=H3)) — array form without string criteria
  • =COUNTIF(B2:B301,">="&H2)-COUNTIF(B2:B301,">"&H3) — two single-condition counts subtracted (uses COUNTIF, which this task does not accept)
  • =COUNTIFS(B2:B301,">="&$H$2,B2:B301,"<="&$H$3) — absolute references; same result, handy when the formula is copied elsewhere

Erros comuns

Typing the dates into the criteria (">=2026-08-01") or forgetting the &: the comparison then happens against text, the count comes out as 0 or as the whole column, and changing H2 or H3 does nothing — the grader changes both cells and expects the count to follow.

Como corrigimos

Qualquer fórmula que produza o resultado certo é aceita, a menos que a tarefa cite uma função: nesse caso, outra função vale metade da pontuação. Comparamos os valores com uma pequena tolerância e ignoramos maiúsculas e espaços no texto. Um número certo digitado à mão em vez de uma fórmula vale metade da pontuação. Tarefas com várias células valem a pontuação integral com 100% das células certas e metade a partir de 50%. Quando faz diferença, também mudamos uma célula de entrada em uma cópia da sua planilha e verificamos se sua fórmula acompanha.

Respostas calculadas com as regras do Excel 365 e verificadas no nosso corretor em 16 de novembro de 2026. Autor: GridBelt team.

Nestes programas

  • Excel for Data AnalystsDia 2

Exercícios relacionados

  • Orders per region and month with COUNTIFSIntermediário, ~7 min
  • Orders per status with COUNTIFIniciante, ~5 min
  • Total of orders above $500Iniciante, ~4 min

Referência da função

Documentação oficial

Próximo exercício

Sales by region with SUMIF