Consulting

Results 1 to 5 of 5

Thread: Product if...

  1. #1

    Product if...

    I know I've done this before....I'm just drawing a blank as to how.....
    column A is numbers. Column B is "yes" or "no".
    I want to multiply all the values in column A that the corresponding column B is "yes". i know there's a "sumif" function if I wanted to add them together, but I need to multiply.

    thanks in advance....

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    =PRODUCT((A1:A6)^(--(B1:B6="yes")))
    Enter as an array formula
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    thank you!
    can you explain this formula to me? what does the "--" mean?

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    See example
    You don't really need --; force of habit!
    =PRODUCT((A1:A6)^(B1:B6="yes"))
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    very cool! learned a lot from that example. thank you!

Posting Permissions

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