+ Reply to Thread
Results 1 to 6 of 6

Formula to make product of two negative numbers negative

  1. #1
    Registered User
    Join Date
    11-14-2008
    Location
    Brooklyn, NY, USA
    Posts
    53

    Smile Formula to make product of two negative numbers negative

    Hi All,

    I have a large dataset (24000 rows) that requires me to multiply two different columns of integers. In some cases, the two integers are both negative and multiplying them results in a product that is positive. I actually need that product to be negative rather than positive. I can't quite seem to figure out the best way to accomplish this.

    Any ideas? I poked around the forum and web a bit and wasn't able to find anything dealing with this specific issue.

    Thanks in advance for the help.

    Cheers
    Last edited by judasdac; 05-12-2009 at 04:07 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,578

    Re: Formula to make product of two negative numbers negative

    Hard to say without more info but by using an IF statement
    Please Login or Register  to view this content.
    Does that help?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: Formula to make product of two negative numbers negative

    What in other cases?
    neg*neg=neg
    pos*pos=?
    pos*neg=?
    neg*pos=?

  4. #4
    Registered User
    Join Date
    11-14-2008
    Location
    Brooklyn, NY, USA
    Posts
    53

    Re: Formula to make product of two negative numbers negative

    Sorry about the lack of info and context. I would've uploaded the worksheeet, but we've been blocked from doing that here.

    With the exception of neg*neg = neg, I'd like the product to remain as per normal:

    pos * pos = pos
    pos * neg = neg
    neg * pos = neg
    neg* neg = neg

  5. #5
    Registered User
    Join Date
    11-14-2008
    Location
    Brooklyn, NY, USA
    Posts
    53

    Re: Formula to make product of two negative numbers negative

    I used ChemistB's formula and it works great!!!! Thanks a lot for the help. My life just got much easier :-)

  6. #6
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Formula to make product of two negative numbers negative

    =(1-2*(c8<0)*(d8<0))*c8*d8
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


+ 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