+ Reply to Thread
Results 1 to 8 of 8

Help Deciphering formula?

  1. #1
    Registered User
    Join Date
    11-14-2013
    Location
    Pensacola
    MS-Off Ver
    Excel 2013
    Posts
    3

    Help Deciphering formula?

    I am trying to decipher the following Formula, so that I can I put it into SQL, however it is kicking me right square in the nuts.

    =IF(AND(W7+H7<=0,IF(E7-H7-S7>0,E7-H7-S7,0)<=0),0,IF(W7+H7<IF(E7-H7-S7>0,E7-H7-S7,0),IF(W7+H7<0,0,W7+H7),IF(E7-H7-S7>0,IF(W7>H7,E7-S7,H7+AF7),H7)))


    I have tried splitting it up into the relevant portions for comparisons, but the and operator is throwing me off.

    I had thought it would break apart into something like this:
    =IF(AND
    (W4+H4<=0,IF(E4-H4-S4>0,then E4-H4-S4, else 0)<=0),then 0, else

    IF(W4+H4<IF(E4-H4-S4>0,then E4-H4-S4,else 0)

    ,IF(W4+H4<0,then 0,else W4+H4)
    ,IF(E4-H4-S4>0,
    IF(W4>H4,then E4-S4,else H4+AF4),H4)
    )
    )

    However that doesn't seem to be the case as the And clause wants everything to be "True/ False"

    My end goal is to put this into SQL, so I am literally trying to work this up as a series of case statements.

    Thank you for any light you can shed on this.

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

    Re: Help Deciphering?

    the and statement basicallly breaks down as this :
    AND(
    W7+H7<=0 {true or false}
    ,
    IF(E4-H4-S4>0,{if true}E4-H4-S4,{If false} 0)<=0 {true or false}{this could actually be simplified to (E4-H4-S4)<=0, I believe, but it may be easier to translate in the if format, haven't used SQL much, so not sure}
    ) {end of AND}
    which will be 2 boolean values, if both are true then return a 0, else go on to the nested IF statement

    Hope this helps
    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

  3. #3
    Registered User
    Join Date
    11-14-2013
    Location
    Pensacola
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Help Deciphering?

    So Definitely the first two have to be true to return '0', and if not then the nested If?

    I can work with that if its the case.

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

    Re: Help Deciphering?

    yes, if BOTH conditions in the AND return true, then the value 0 is given, otherwise you get the results of the nested if

  5. #5
    Registered User
    Join Date
    11-14-2013
    Location
    Pensacola
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Help Deciphering?

    Awesome!
    Thank you so much, time to VPN back in to work, and finish that stupid worksheet!

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

    Re: Help Deciphering?

    LOL

    You are very welcome! Glad I could help !

  7. #7
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Help Deciphering?

    FORUM MODERATOR'S NOTE:

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as "SOLVED".
    For the meantime I'll do it for you.

    How?
    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

    Note:
    You can also thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given.
    By doing so you can add to the reputation(s) of those who helped and shared their time in helping you.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

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

    Re: Help Deciphering?

    Thanks vlady seems my signature is on a "Maybe yes, maybe no" trip...lol

+ 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] Help Deciphering/Modifying Formula using NETWORKDAYS
    By abbeycrombie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-17-2013, 11:28 AM
  2. Deciphering a Formula
    By Winstonwolf in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-29-2012, 04:05 PM
  3. Deciphering a formula
    By MarginofBuffett in forum Excel General
    Replies: 1
    Last Post: 11-15-2010, 04:05 AM
  4. Another one i need deciphering...
    By Dan Mackman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-26-2007, 06:04 PM
  5. Newbie needs help deciphering formula.
    By Grimzby in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-16-2006, 11:50 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