Forestq

Active Member
Joined
May 9, 2010
Messages
482
Hi,

I have function to count how many many times name from column C (sheet M1) appear in range (sheet CSTG, column B):
Code:
=COUNTIFS(CSTG!$B:$B,'M1'!C7)
Column CColumn D - only count
Audi5
BMW7
VW10
Fiat3

<tbody>
</tbody>

Now in column Q (sheet CSTG) I have different values, like: 1, 1.0, 1.2, 2.0, 3.2 etc.

I need to count how many different values is for each name for column C.

Column CColumn DColumn E - diffrent version
Audi32
BWM75
VW104
Fiat32

<tbody>
</tbody>

What should I do?
 

Forestq

Active Member
Joined
May 9, 2010
Messages
482
I found something like below:

Code:
​=SUMPRODUCT(1/COUNTIF(Q2:Q2000,Q2:Q2000))


but its not working.
 

vllgv

Board Regular
Joined
Oct 27, 2010
Messages
204
Control + Shift + Enter

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>C</th><th>D</th><th>E</th><th>F</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Column C</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">Audi</td><td style="text-align: right;;">1.2</td><td style="text-align: right;;"></td><td style="text-align: right;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">BWM</td><td style="text-align: right;;">2.0</td><td style="text-align: right;;"></td><td style="text-align: right;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">Audi</td><td style="text-align: right;;">1.2</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">BWM</td><td style="text-align: right;;">3.0</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:4.2em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet26</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">F2</th><td style="text-align:left">{=SUM(<font color="Blue">IF(<font color="Red">FREQUENCY(<font color="Green">IF(<font color="Purple">$C$2:$C$5<>"",
IF(<font color="Teal">$C$2:$C$5=C2,MATCH(<font color="#FF00FF">$D$2:$D$5,$D$2:$D$5,0</font>)</font>)</font>),
ROW(<font color="Purple">$C$2:$C$5</font>)-ROW(<font color="Purple">$A$2</font>)+1</font>),1</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 

Forestq

Active Member
Joined
May 9, 2010
Messages
482
HI,

I made like:
Code:
=SUM(IF(FREQUENCY(IF($C$7:$C$168<>"",IF($C$7:$C$168=C2,MATCH(CSTG!$Q$2000:$Q$2000,CSTG!$Q$2000:$Q$2000,0))),ROW($C$168:$C$168)-ROW($C$2)+1),1))
but Im getting O or N/A. My rows with values starts from row 7, and duplicates values normally starts from row 2.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
HI,

I made like:
Code:
=SUM(IF(FREQUENCY(IF($C$7:$C$168<>"",IF($C$7:$C$168=C2,MATCH(CSTG!$Q$2000:$Q$2000,CSTG!$Q$2000:$Q$2000,0))),ROW($C$168:$C$168)-ROW($C$2)+1),1))
but Im getting O or N/A. My rows with values starts from row 7, and duplicates values normally starts from row 2.
Care to state clearly where your data is? You mention a confusing set of columns and sheet names.
 

Forestq

Active Member
Joined
May 9, 2010
Messages
482
sheet CSTG - data source, column B- repeated values like Audi, BWM, column Q - diffrent version

sheet M1 - my template, where I keep in column C uniq values from column B(sheet CSTG), and here, I need to add count of diffrent version
 

vllgv

Board Regular
Joined
Oct 27, 2010
Messages
204
try: =SUM(IF(FREQUENCY(IF(CSTG!$B$2:$B$2000<>"",
IF(CSTG!$B$2:$B$2000=C2,MATCH(CSTG!$Q$2:$Q$2000,CSTG!$Q$2:$Q$2000,0))),
ROW(CSTG!$Q$2:$Q$2000)-ROW($A$2)+1),1))

w Control Shift Enter
 
Last edited:

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
sheet CSTG - data source, column B- repeated values like Audi, BWM, column Q - diffrent version

sheet M1 - my template, where I keep in column C uniq values from column B(sheet CSTG), and here, I need to add count of diffrent version
In D2 of M1 (sheet M1) control+shift+enter, not just enter, and copy down:
Rich (BB code):

=SUM(IF(FREQUENCY(IF(CSTG!$Q$2:$Q$100<>"",IF(CSTG!$B$2:$B$100=$C2,
    MATCH(CSTG!$Q$2:$Q$100,CSTG!$Q$2:$Q$100,0))),
    ROW(CSTG!$Q$2:$Q$100)-ROW(CSTG!$Q$2)+1),1))
 

Forestq

Active Member
Joined
May 9, 2010
Messages
482
thanks Aladin, works great!

one more question: how can I add to the function one condition, let say:
- values from column G sheet CSTG should be = "Completed" ?
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
thanks Aladin, works great!

one more question: how can I add to the function one condition, let say:
- values from column G sheet CSTG should be = "Completed" ?
Control+shift+enter and copy down:
Rich (BB code):

=SUM(IF(FREQUENCY(IF(CSTG!$Q$2:$Q$100<>"",IF(CSTG!$B$2:$B$100=$C2,
    IF(CSTG!$G$2:$G$100="Completed",
    MATCH(CSTG!$Q$2:$Q$100,CSTG!$Q$2:$Q$100,0)))),
    ROW(CSTG!$Q$2:$Q$100)-ROW(CSTG!$Q$2)+1),1))
 

Forum statistics

Threads
1,081,677
Messages
5,360,451
Members
400,586
Latest member
Minty

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top