+ Reply to Thread
Results 1 to 7 of 7

how do i only show contracts that have both positive and negative values associated ?

  1. #1
    Forum Contributor
    Join Date
    06-21-2009
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    200

    how do i only show contracts that have both positive and negative values associated ?

    Please see table. I have a bunch of contracts and they each row has a dollar value. A contract can appear multiple times in a sheet. Sometimes they'll have a positive value sometimes a negative. I only care about the ones that have both a positive and a negative value (because they'll often match so I can delete them without changing the total).

    What formula would I type into Col C?

    I'd be grateful for any help!


    Contract # Dollar Amount Value I Want
    ABC +5 Yes
    ABC -5 Yes
    ABC +5 Yes
    DEF +10 No
    DEF +15 No
    GHI -10 No
    GHI -15 No

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: how do i only show contracts that have both positive and negative values associated ?

    one option

    C2: =IF($A2=$A1,$C1,IF(SUM(SIGN(COUNTIFS($A$2:$A$8,$A2,$B$2:$B$8,{"<0",">0"}))*{-1,1})=0,"Yes","No"))
    copied down

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: how do i only show contracts that have both positive and negative values associated ?

    One way:

    =IF(AND(COUNTIFS(A:A,A4,B:B,">0")>=1,COUNTIFS(A:A,A4,B:B,"<0")>=1),"Yes","No")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,494

    Re: how do i only show contracts that have both positive and negative values associated ?

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: how do i only show contracts that have both positive and negative values associated ?

    Another one

    =IF(PRODUCT(COUNTIFS(A$2:A$8,A2,B$2:B$8,{"<0",">0"})),"Yes","No")

  6. #6
    Forum Contributor
    Join Date
    06-21-2009
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2007
    Posts
    200

    Re: how do i only show contracts that have both positive and negative values associated ?

    Thanks guys! Sorry just seeing this now somehow.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: how do i only show contracts that have both positive and negative values associated ?

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

+ 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] How to hide negative values but show positive values?
    By eeps24 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2018, 05:49 PM
  2. [SOLVED] Formula to show positive number instead of negative
    By werko in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-10-2015, 04:24 AM
  3. if positive or negative, need words to show up in next column
    By asach1211 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2014, 03:18 PM
  4. Date formula if positive show, if negative don't show.
    By Cyberpawz in forum Excel General
    Replies: 8
    Last Post: 03-14-2012, 07:49 AM
  5. Show negative numbers as positive in a pivot
    By Cunner in forum Excel General
    Replies: 0
    Last Post: 11-22-2011, 10:30 AM
  6. If Negative Show Amount, If Positive Show Zero
    By rdusseau in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-23-2008, 11:25 AM
  7. Replies: 4
    Last Post: 09-26-2005, 06:05 PM

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