+ Reply to Thread
Results 1 to 7 of 7

ProductIf

  1. #1
    Registered User
    Join Date
    05-22-2010
    Location
    Slovenia
    MS-Off Ver
    Excel 2007
    Posts
    3

    ProductIf

    Hi!

    I need help.

    In column "F", I have numbers.
    In column "G", I have numbers.
    In column "H", I have 3 options (words). -> Won, Lost, Cancel

    In column "I" I want the following:

    IF "H" = "Won" Then "I" = "F" * "G"
    IF "H" = "Lost" Then "I" = "G" * (-1)
    IF "H" = "Cancel" Then "I" = "G"

    Example:

    F1=2
    G1=3
    H1=Win
    I1=F1*G1=2*3=6

    F2=3
    G2=4
    H2=Lost
    I2=4*(-1)= -4

    F3=5
    G3=8
    H3=Cancel
    I3=G3=8


    So in column "I" I want:
    - sum of "F" and "G"
    - negative "G"
    - equal G

    Depending on what is in the "H" column. I am new and have no idea how to do this, I am hoping someone here could help me. I am still learning and sumif and sumifs functions are easy for me, and could do this for sums myself... but here I need a product.

    I hope I wrote clear enough what I want, thanks for the help.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    re: ProductIf

    Hi pdsvsv
    Maybe,...
    in I1 = if (H1="Win", F1*G1,if(H1="Lost",-G1,G1))
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    05-22-2010
    Location
    Slovenia
    MS-Off Ver
    Excel 2007
    Posts
    3

    re: ProductIf

    No this does not work pike... I have excel 2007 if it makes a difference.

    Basicaly I don't care what the function is - be it IF function or whatever else, I just need something to check a column, and do 3 different things depending on what that column that it check says... So always checking for "Win" "Lost" "Cancel" and then doing one of the 3 predetermined actions for each (multiplying, making negative, or just copying cell value.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    re: ProductIf

    A workbook with examples and explanations ...
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    05-22-2010
    Location
    Slovenia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: ProductIf

    Check example.jpg hope it explains bit better then words.
    Attached Images Attached Images

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: ProductIf

    Hi pdsvsv

    =SUMPRODUCT((H1:H7="Win")*(F1:F7)*(G1:G7))
    =SUMPRODUCT((H1:H7="Lost")*(G1:G7)*(-1))
    =SUMPRODUCT((H1:H7="Cancel")*(G1:G7))

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: ProductIf

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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