Function help!

CaseyDoes

New Member
Joined
Mar 27, 2011
Messages
10
  1. I was trying to use the COUNTIF function on two sheets.
Sheet1
<table border="0" cellspacing="0" cols="2" frame="VOID" rules="NONE"> <colgroup><col width="86"><col width="86"></colgroup> <tbody> <tr> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="LEFT">returns the count of "Alpha"(A1), when it is not equal to "c"
</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Beta</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> </tbody> </table>
Sheet 2
<table border="0" cellspacing="0" cols="2" frame="VOID" rules="NONE"> <colgroup><col width="86"><col width="86"></colgroup> <tbody> <tr> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="LEFT">c</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">c</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">c</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Beta</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> </tbody> </table>
My current attempt was this:
=COUNTIF(Sheet2.$A$1:$A$99;A1 & Sheet2.B1:B7 != 'c')

2.

<table border="0" cellspacing="0" cols="2" frame="VOID" rules="NONE"> <colgroup><col width="86"><col width="86"></colgroup> <tbody> <tr> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="LEFT">finds the correlating number of the multiple instances and adds the together.
</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Beta</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT">
</td> </tr> </tbody> </table>

<table border="0" cellspacing="0" cols="2" frame="VOID" rules="NONE"> <colgroup><col width="86"><col width="86"></colgroup> <tbody> <tr> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" width="86" align="RIGHT">3</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" align="RIGHT">4</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="RIGHT">6</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Beta</td> <td style="border: 1px solid rgb(0, 0, 0);" align="RIGHT">7</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Alpha</td> <td style="border: 1px solid rgb(0, 0, 0);" align="RIGHT">2</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="RIGHT">5</td> </tr> <tr> <td style="border: 1px solid rgb(0, 0, 0);" align="LEFT" height="17">Gamma</td> <td style="border: 1px solid rgb(0, 0, 0);" align="RIGHT">3</td> </tr> </tbody> </table>
In example the function would find A1, A2, & A5 equal to "Alpha" and add 3, 4, 2 together resulting in 9.

Also, what if I wanted to list the results instead of add them? Like My result would be '3,4,2'.

Thanks.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
The answer to (1) depends on the version of Excel you are using.

If you are using Excel 2007 or later, you can use COUNTIFS() like this:
Code:
=COUNTIF(Sheet2!$A$1:$A$99;A1;Sheet2!$B$1:$B$99;"c")

For (2) you can use SUMIF()
Code:
=SUMIF(Sheet2!$A$1:$A$99;A1;Sheet2!$B$1:$B$99)

Adjust cell references as necessary.
 
Upvote 0
Sadly I have 2003 up at work.
=COUNTIF(Sheet2!$A$1:$A$99;A1;Sheet2!$B$1:$B$99;"c")
OK, this will work in any version of Excel:

=SUMPRODUCT(--(Sheet2!$A$1:$A$99=A1);--(Sheet2!$B$1:$B$99="c"))

Use the appropriate argument separator for your location. Semi-colons or commas.

The SUMIF formula will also work in any version of Excel.
 
Upvote 0
SUMPRODUCT & SUMIF worked out great!

Now how would I spit out the list of names?

Also, Since I am new at this is there anywhere to reference all these functions? I just want to print them all out and study study study!
 
Upvote 0
SUMPRODUCT & SUMIF worked out great!

Now how would I spit out the list of names?

Also, Since I am new at this is there anywhere to reference all these functions? I just want to print them all out and study study study!
If you want the results all in a single cell like 3,4,2 then you'll need to use VBA programming.

If you can use separate cells for each result then it can be done with a formula.
 
Upvote 0
Also, Since I am new at this is there anywhere to reference all these functions? I just want to print them all out and study study study!
The Excel help files list all the functions with simple examples of their use.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top