+ Reply to Thread
Results 1 to 6 of 6

Formula

  1. #1
    BSantos
    Guest

    Formula

    =IF(AND(G6=0,O6=0),P6,IF(G6=0,O6,G6-N6))

    The above formula is in cell Q6 the results is a negative number. example
    -2. I want to add to this formula above that if the results is less than Zero
    than give me Zero.

    Any help!

    B.

  2. #2
    soxcpa@gmail.com
    Guest

    Re: Formula

    You can use the MAX function make it only give you 0 and higher as
    follows:

    =MAX ( ##, 0)

    thus:
    =MAX(IF(AND(G6=0,O6=0),P6,IF(G6=0,O6,G6-N6)),0)



    BSantos wrote:
    > =IF(AND(G6=0,O6=0),P6,IF(G6=0,O6,G6-N6))
    >
    > The above formula is in cell Q6 the results is a negative number. example
    > -2. I want to add to this formula above that if the results is less than Zero
    > than give me Zero.
    >
    > Any help!
    >
    > B.



  3. #3
    Sandy Mann
    Guest

    Re: Formula

    Assuming that you mean G6-N6 is negative try:

    =IF(AND(G6=0,O6=0),P6,IF(G6=0,O6,MAX(0,G6-N6)))


    --
    HTH

    Sandy
    sandymann2@mailinator.com
    Replace@mailinator.com with @tiscali.co.uk


    "BSantos" <BSantos@discussions.microsoft.com> wrote in message
    news:BAC67386-D6A0-479C-9F98-33AE85813782@microsoft.com...
    > =IF(AND(G6=0,O6=0),P6,IF(G6=0,O6,G6-N6))
    >
    > The above formula is in cell Q6 the results is a negative number. example
    > -2. I want to add to this formula above that if the results is less than
    > Zero
    > than give me Zero.
    >
    > Any help!
    >
    > B.




  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,723
    try this formula

    =MAX(0,IF(G6,G6-N6,IF(O6,O6,P6))

  5. #5
    BSantos
    Guest

    Re: Formula

    Sandy, could you help me with this one:

    =IF($I$2="Active",VLOOKUP($E6,Data!$G$4:$AT$1587,28,0),"0")

    I have this formula above in a cell. I want to add that if the vlookup
    doesn't find anything and returns a #N/A than give me ZERO.

    I'm doing this so I don't get #n/a in the column and my totals will add up
    without giving me #n/a.

    "Sandy Mann" wrote:

    > Assuming that you mean G6-N6 is negative try:
    >
    > =IF(AND(G6=0,O6=0),P6,IF(G6=0,O6,MAX(0,G6-N6)))
    >
    >
    > --
    > HTH
    >
    > Sandy
    > sandymann2@mailinator.com
    > Replace@mailinator.com with @tiscali.co.uk
    >
    >
    > "BSantos" <BSantos@discussions.microsoft.com> wrote in message
    > news:BAC67386-D6A0-479C-9F98-33AE85813782@microsoft.com...
    > > =IF(AND(G6=0,O6=0),P6,IF(G6=0,O6,G6-N6))
    > >
    > > The above formula is in cell Q6 the results is a negative number. example
    > > -2. I want to add to this formula above that if the results is less than
    > > Zero
    > > than give me Zero.
    > >
    > > Any help!
    > >
    > > B.

    >
    >
    >


  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,723
    You can do it this way

    =IF(OR($I$2="Active",ISNA(VLOOKUP($E6,Data!$G$4:$AT$1587,28,0))),0,VLOOKUP($E6,Data!$G$4:$AT$1587,28,0))

+ 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