+ Reply to Thread
Results 1 to 7 of 7

Nested If statement Help! halfway got it figured out

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    shelby,usa
    MS-Off Ver
    Excel 2010
    Posts
    32

    Nested If statement Help! halfway got it figured out

    Will be so simple for most but me I just cant get it figured out.
    In cell e20 I want a if (d20-c20)*10000 is between -75 and +75 (d20-c20)*10000 but if (d20-c20)*10000 is greater than -75 or +75 leave cell blank

    other words if (d20-c20)*10000 falls between 75 and negative 75 I want it to put the value of (d20-c20)*10000 if it is outside of 75 and negative 75 I want it to put a empty space in cell " "


    I can have two seperate formulas that seem to work but I can not combine the two forumlas into one

    =IF((D20-C20)*10000>+-75," ",(D20-C20)*10000)
    =IF((D20-C20)*10000<+-75," ",(D20-C20)*10000)

    Thanks in advance!

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Nested If statement Help! halfway got it figured out

    Will this work:

    =IF(ABS((D20-C20)*10000)<=75,(D20-C20)*10000,"")

    The formula above is a shorter way of writing:
    =IF(AND((D20-C20)*10000>=-75,(D20-C20)*10000<=75),(D20-C20)*10000,"")

    - Moo
    Last edited by Moo the Dog; 01-26-2013 at 12:02 AM. Reason: Change evaluation, again

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    shelby,usa
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Nested If statement Help! halfway got it figured out

    That did not work I get a False listed no matter what the value of (D20-C20)*10000 is.

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Nested If statement Help! halfway got it figured out

    That's odd, both formulas seem to work for me... see my attached sheet.
    - Moo
    Attached Files Attached Files

  5. #5
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Nested If statement Help! halfway got it figured out

    @Moo:
    i thought your initial formula was the right one since OP wanted
    between 75 and negative 75 I want it to put the value of (d20-c20)*10000 if it is outside of 75 and negative 75 I want it to put a empty space in cell " "
    so anything that equates to less than or equals to 75 should be using that equation. mine was as below but i removed since i was a minute later than you

    =IF(ABS((D20-C20)*10000)>75,"",(D20-C20)*10000)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  6. #6
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Nested If statement Help! halfway got it figured out

    I just have one question ..If you want >+- 75 AND <+-75 at the same time...
    I can have two seperate formulas that seem to work but I can not combine the two forumlas into one

    =IF((D20-C20)*10000>+-75," ",(D20-C20)*10000)
    =IF((D20-C20)*10000<+-75," ",(D20-C20)*10000)
    then all results should be =(D20-C20)*10000...

    maybe I am missing something ?

    Edit-
    Actually, relooking at the quote... they should all return ""...?????
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  7. #7
    Registered User
    Join Date
    01-25-2013
    Location
    shelby,usa
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Nested If statement Help! halfway got it figured out

    Quote Originally Posted by Moo the Dog View Post
    Will this work:

    =IF(ABS((D20-C20)*10000)<=75,(D20-C20)*10000,"")

    The formula above is a shorter way of writing:
    =IF(AND((D20-C20)*10000>=-75,(D20-C20)*10000<=75),(D20-C20)*10000,"")

    - Moo
    Yea that did work sorry. I must have done something in my copy and paste of the formula. I tried the long version but I was thinking since I cne do it in two seperate forumlas that I had to put in two IF statements in it (see below)and could not get to work.

    =IF(D20-C20)*10000>=-75,(D20-C20)*10000,IF(D20-C20)*10000<=+75,(d20-C20)*1000,"")

    THNAKS

+ 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