ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to add entires in column based on another column... (https://www.excelbanter.com/excel-discussion-misc-queries/42292-how-add-entires-column-based-another-column.html)

msbutton27

How to add entires in column based on another column...
 
I have two columns in a spreadsheet, and I need to count the entires in
column two depending on column 1...For example:

Column 1 Column 2
Mike Yes
Mike No
Tom Yes
Mike Yes
Tom No

So In the above example I need to add all the Yes's that Mike has, not all
the yes's just the ones associated to the row Mike is on...

Any ideas, or does this make sense.

....Mike

bj

Sumproduct() will work
=sumproduct(--(column1range="Mike"),--(Column2range="Yes"))
the --( changes the logical true false to a 1,0 numeric response.
the arrays in each section must be the same size but cannot be the shorthand
for full rows or columns (not A:A)

"msbutton27" wrote:

I have two columns in a spreadsheet, and I need to count the entires in
column two depending on column 1...For example:

Column 1 Column 2
Mike Yes
Mike No
Tom Yes
Mike Yes
Tom No

So In the above example I need to add all the Yes's that Mike has, not all
the yes's just the ones associated to the row Mike is on...

Any ideas, or does this make sense.

...Mike


msbutton27

This is what I just tried and it fails - did I do something wrong:

=sumproduct(--(RAW Data'!D1:D400="Mike"),--(RAW Data'!K1:K400="yes"))

I am typing this into the formula bar in Excel - sorry but I am not that
advance with Excel, there afraid I am missing something...

THanks for any help,
Mike

"bj" wrote:

Sumproduct() will work
=sumproduct(--(column1range="Mike"),--(Column2range="Yes"))
the --( changes the logical true false to a 1,0 numeric response.
the arrays in each section must be the same size but cannot be the shorthand
for full rows or columns (not A:A)

"msbutton27" wrote:

I have two columns in a spreadsheet, and I need to count the entires in
column two depending on column 1...For example:

Column 1 Column 2
Mike Yes
Mike No
Tom Yes
Mike Yes
Tom No

So In the above example I need to add all the Yes's that Mike has, not all
the yes's just the ones associated to the row Mike is on...

Any ideas, or does this make sense.

...Mike


Dave Peterson

You dropped a couple of single quotes:

=sumproduct(--('RAW Data'!D1:D400="Mike"),--('RAW Data'!K1:K400="yes"))

(both before "RAW".)

msbutton27 wrote:

This is what I just tried and it fails - did I do something wrong:

=sumproduct(--(RAW Data'!D1:D400="Mike"),--(RAW Data'!K1:K400="yes"))

I am typing this into the formula bar in Excel - sorry but I am not that
advance with Excel, there afraid I am missing something...

THanks for any help,
Mike

"bj" wrote:

Sumproduct() will work
=sumproduct(--(column1range="Mike"),--(Column2range="Yes"))
the --( changes the logical true false to a 1,0 numeric response.
the arrays in each section must be the same size but cannot be the shorthand
for full rows or columns (not A:A)

"msbutton27" wrote:

I have two columns in a spreadsheet, and I need to count the entires in
column two depending on column 1...For example:

Column 1 Column 2
Mike Yes
Mike No
Tom Yes
Mike Yes
Tom No

So In the above example I need to add all the Yes's that Mike has, not all
the yes's just the ones associated to the row Mike is on...

Any ideas, or does this make sense.

...Mike


--

Dave Peterson

msbutton27

It works like a charm....

Thanks,
Mike

"Dave Peterson" wrote:

You dropped a couple of single quotes:

=sumproduct(--('RAW Data'!D1:D400="Mike"),--('RAW Data'!K1:K400="yes"))

(both before "RAW".)

msbutton27 wrote:

This is what I just tried and it fails - did I do something wrong:

=sumproduct(--(RAW Data'!D1:D400="Mike"),--(RAW Data'!K1:K400="yes"))

I am typing this into the formula bar in Excel - sorry but I am not that
advance with Excel, there afraid I am missing something...

THanks for any help,
Mike

"bj" wrote:

Sumproduct() will work
=sumproduct(--(column1range="Mike"),--(Column2range="Yes"))
the --( changes the logical true false to a 1,0 numeric response.
the arrays in each section must be the same size but cannot be the shorthand
for full rows or columns (not A:A)

"msbutton27" wrote:

I have two columns in a spreadsheet, and I need to count the entires in
column two depending on column 1...For example:

Column 1 Column 2
Mike Yes
Mike No
Tom Yes
Mike Yes
Tom No

So In the above example I need to add all the Yes's that Mike has, not all
the yes's just the ones associated to the row Mike is on...

Any ideas, or does this make sense.

...Mike


--

Dave Peterson



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

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