+ Reply to Thread
Results 1 to 5 of 5

Help with a nested function.

  1. #1
    Registered User
    Join Date
    12-09-2005
    Posts
    5

    Help with a nested function.

    Help,

    Here is the problem. I have two columns of data. for example:

    Column A
    1
    3
    4
    0
    2
    0
    0
    3

    Column B
    Product A
    Product A
    Product B
    Product B
    Product A
    Product A
    Product B
    Product B

    What I need the function to return is:
    Product A - 3
    Product B - 2

    This is what I thought the function should look like but it is not working:

    =IF(A6:A50>0,COUNTIF(A6:A50,"Product A"),0)

    If Product A or B did not have any values >0, it would return a zero.

    Thanks for any help!
    Last edited by fivestringfreak; 01-29-2009 at 12:26 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    21,528

    Re: Help with a nested function.

    Please Login or Register  to view this content.
    To elaborate on the IF approach you would need to use an array entered within CTRL + SHIFT + ENTER:

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 01-29-2009 at 12:13 PM. Reason: added COUNT(IF(

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: Help with a nested function.

    Try sumproduct

    =Sumproduct(($B$1:$B$10="Product A")*($A$1:$A$10>0))

    adjust ranges to suit..

    You can also replace "Product B" with cell referencing it so that you can copy formula down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    12-09-2005
    Posts
    5

    Re: Help with a nested function.

    Holy cow that was fast! Thanks Guys!

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Help with a nested function.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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