Saltar al contenido principal

¿Cómo contar filas hasta que se alcance un cierto valor de suma en Excel?

Por ejemplo, hay un rango de datos, la columna A incluye el número de producto y la columna B contiene el monto del pedido, y usted tiene un cierto valor como 80, que es el total de los primeros números enésimo del Pedido, ¿cómo puede contar cuántos Las filas están involucradas para sumar 80 como se muestra a continuación.
doc count hasta que la suma llegue a 1

Cuente filas hasta que se alcance un cierto valor sumado con la fórmula


flecha azul burbuja derecha Cuente filas hasta que se alcance un cierto valor sumado con la fórmula

Para contar el número de filas que se utilizan para sumar un determinado valor coincidente, puede aplicar una fórmula.

Seleccione una celda en blanco, E2 por ejemplo, e ingrese esta fórmula =MATCH(D2,SUBTOTAL(9,OFFSET(B2,,,ROW(B2:B17)-ROW(B2))),1), prensa Mayús + Ctrl + Entrar clave para llegar al resultado correcto. Ver captura de pantalla:
doc count hasta que la suma llegue a 2

Consejo: En esta fórmula, D2 es el valor seguro que desea alcanzar al sumar, B2: B17 es el rango de valores desde el que suma, puede cambiarlos según lo necesite.

Si desea excluir la fila del encabezado, puede usar esta fórmula =MATCH(D2,SUBTOTAL(9,INDIRECT("$B$1"&":"&ADDRESS(ROW($B$1:$B$17),COLUMN($B$1))))y presione el  Mayús + Ctrl + Entrar llaves al mismo tiempo

Las mejores herramientas de productividad de oficina

🤖 Asistente de IA de Kutools: Revolucionar el análisis de datos basado en: Ejecución inteligente   |  Generar codigo  |  Crear fórmulas personalizadas  |  Analizar datos y generar gráficos  |  Invocar funciones de Kutools...
Características populares: Buscar, resaltar o identificar duplicados   |  Eliminar filas en blanco   |  Combine columnas o celdas sin perder datos   |   Ronda sin fórmula ...
Super búsqueda: Búsqueda virtual de criterios múltiples    Búsqueda V de valores múltiples  |   VLookup en varias hojas   |   Búsqueda difusa ....
Lista desplegable avanzada: Crear rápidamente una lista desplegable   |  Lista desplegable dependiente   |  Lista desplegable de selección múltiple ....
Administrador de columnas: Agregar un número específico de columnas  |  Mover columnas  |  Toggle Estado de visibilidad de columnas ocultas  |  Comparar rangos y columnas ...
Características destacadas: Enfoque de cuadrícula   |  Vista de diseño   |   Gran barra de fórmulas    Administrador de hojas y libros de trabajo   |  Biblioteca de Recursos (Texto automático)   |  Selector de fechas   |  Combinar hojas de trabajo   |  Cifrar/descifrar celdas    Enviar correos electrónicos por lista   |  Súper filtro   |   Filtro especial (filtro negrita/cursiva/tachado...) ...
Los 15 mejores conjuntos de herramientas12 Texto Herramientas (Añadir texto, Quitar caracteres, ...)   |   50+ Tabla Tipos (Diagrama de Gantt, ...)   |   40+ Práctico Fórmulas (Calcular la edad según el cumpleaños, ...)   |   19 Inserción Herramientas (Insertar código QR, Insertar imagen desde la ruta, ...)   |   12 Conversión Herramientas (Números a palabras, Conversión de Moneda, ...)   |   7 Fusionar y dividir Herramientas (Filas combinadas avanzadas, Células partidas, ...)   |   ... y más

Mejore sus habilidades de Excel con Kutools for Excel y experimente la eficiencia como nunca antes. Kutools for Excel ofrece más de 300 funciones avanzadas para aumentar la productividad y ahorrar tiempo.  Haga clic aquí para obtener la función que más necesita...

Descripción


Office Tab lleva la interfaz con pestañas a Office y hace que su trabajo sea mucho más fácil

  • Habilite la edición y lectura con pestañas en Word, Excel, PowerPoint, Publisher, Access, Visio y Project.
  • Abra y cree varios documentos en nuevas pestañas de la misma ventana, en lugar de en nuevas ventanas.
  • ¡Aumenta su productividad en un 50% y reduce cientos de clics del mouse todos los días!
Comments (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, how would the formula be if instead of D2 I want it to be an established range of data?
This comment was minimized by the moderator on the site
MATCH(D2,SUBTOTAL(9,OFFSET(B2,,,ROW(B2:B17)-ROW(B2))),1)this formula is not working on google sheets any info about that
This comment was minimized by the moderator on the site
Hi, Suresh, above formula only work in Microsoft Excel, if you want to count rows until a target sum reach in google sheet, you need a helper column, and the COUNTIF function. Specific operations as below screenshot shown. Please let me know if this help you.
This comment was minimized by the moderator on the site
hi , what can be the formula but to count columns?
This comment was minimized by the moderator on the site
Hello, Diane, just change ROW to COLUMN in the formula like =MATCH(A2,SUBTOTAL(9,OFFSET(A1,,,COLUMN(A1:E1)-COLUMN(B2))),1). See screenshot:
This comment was minimized by the moderator on the site
This doesn't work - I think it's because subtotal only works vertically?
This comment was minimized by the moderator on the site
After reading this solution, I started reading about array formulas. Very interesting and useful. With respect to this solution, it solves a very challenging aspect of material stockpile size and composition tracking. Can you help me with one little change...I want the position in the list of the total going from the bottom of the list up vs top down in your example. I've tried a few things but not cracked it yet, mainly due to not fully understanding the formula syntax yet. Any suggestions? Particularly interested in the exclude header version, or a version that does not include any header consideration since I wish to calculate this fresh on each row (i.e. day.)
This comment was minimized by the moderator on the site
Never mind. I figured out a simple, non array way to do what I wanted to do.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations