+ Reply to Thread
Results 1 to 9 of 9

formula that can count the data in a cell but if the data are the same they count as 1 ??

  1. #1
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Unhappy formula that can count the data in a cell but if the data are the same they count as 1 ??

    formula that can count the data in a cell but if the data are the same they count as 1 ?? anybody can helpme. please.. godbless
    Last edited by jasond1992; 09-27-2015 at 09:18 PM. Reason: SOLVED

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    Perhaps something like this.

    Note: this is an array formula, so type the formula in then press CTRL SHIFT ENTER.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    i have the result this sir.

    #DIV/0!

  4. #4
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    sir here's what hppen wen i input.....
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    Ahh, that's from the blank cells methinks.

    Try this one instead. Changes highlighted in red.

    Again, CTRL SHIFT ENTER
    =SUM(IFERROR(1 / COUNTIF(B4:B400, B4:B400),0))
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    Thank you so much sir. can i ask what is the different between array formula and formula only ?

  7. #7
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    An array formula, is a formula that has "multiple" outputs.

    For example, in a standard COUNTIF function, it usually returns 1 output (e.g. COUNTIF(Fruits , Apple)) will return you 1 number representing the number of apples in the basket of fruits.

    What I've done above is to do something like COUNTIF(Fruits , {Apple, Banana}), which has 2 outputs, first being the number of apples, and second being the number of bananas. In this case, you'll need to select 2 cells, and type in the formula with the CTRL SHIFT ENTER to see both answers.

    I've added 1 more step, which is to combine all the outputs, and that is using the SUM function. So, some examples:

    1) COUNTIF(Fruits , Apple) = x --> not an array formula
    2) COUNTIF(Fruits , Banana) = y --> not an array formula
    3) COUNTIF(Fruits, {Apple, Banana}) = {x , y} --> is an array formula
    4) SUM(COUNTIF(Fruits, {Apple, Banana})) = SUM({x,y}) = x + y = z --> not an array formula... but
    because (3) is an array formula, you still need to tell Excel to process the data as an array formula (CTRL SHIFT ENTER)

  8. #8
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    aahhhh> Thankyou so much sir "quekbc"
    This "{}" is an array formula if i use this ? or simply us ( CTRL SHIFT ENTER )

  9. #9
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: formula that can count the data in a cell but if the data are the same they count as 1

    Oh, which one are you talking about? The {} that I used in my examples above? or the one that you see when you type CTRL SHIFT ENTER?

    In Excel, when you type a formula and you do CTRL SHIFT ENTER, it will automatically put the {}s in, e.g. {=SUM(ROW(1:10))}. These curly brackets should only be done by doing CTRL SHIFT ENTER.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA to count data in Column and paste the count in different sheet
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-02-2014, 03:54 PM
  2. HELP, count data in cell formula
    By friss in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-27-2014, 07:57 AM
  3. [SOLVED] Formula to count frequency of data in cell range based on data in different cell range
    By jrosko1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-12-2013, 09:47 AM
  4. get a count of filtered data , count should be as values in cell.
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2012, 06:31 PM
  5. [SOLVED] formula for cell count matrixed data & result going to sheet 2
    By Red fuji in forum Excel General
    Replies: 2
    Last Post: 05-26-2012, 02:40 AM
  6. Replies: 1
    Last Post: 02-09-2010, 06:16 PM
  7. Need a formula to count data
    By rbhedal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2009, 03:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1