ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting formula (https://www.excelbanter.com/excel-worksheet-functions/259429-counting-formula.html)

lawhawg

Counting formula
 
I need a formula to sum on the cells that match a variable in another cell

A B C D E F G H I
1
2 Bo Jim Ron
3 3 2 6
4 1 2 3 4 5 6 ? ? ?

What I need to be able to do is sum the number of columns (A4:F4) that
matches the numbers in G3:I3. So, the sum I'm looking for in G4 is 6 (the
sum of A4:C4) or 6. H4 would sum to 3 and I4 would be 21. Can you help me
please?

T. Valko

Counting formula
 
Try this...

=SUM($A4:INDEX($A4:$F4,G3))

Copy across.

Note that if G3 is an empty cell the formula will sum the *entire* range.

--
Biff
Microsoft Excel MVP


"lawhawg" wrote in message
...
I need a formula to sum on the cells that match a variable in another cell

A B C D E F G H I
1
2 Bo Jim Ron
3 3 2 6
4 1 2 3 4 5 6 ? ? ?

What I need to be able to do is sum the number of columns (A4:F4) that
matches the numbers in G3:I3. So, the sum I'm looking for in G4 is 6
(the
sum of A4:C4) or 6. H4 would sum to 3 and I4 would be 21. Can you help
me
please?





All times are GMT +1. The time now is 02:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com