+ Reply to Thread
Results 1 to 7 of 7

Complex IF AND OR function formula

  1. #1
    Registered User
    Join Date
    01-22-2016
    Location
    USA
    MS-Off Ver
    10
    Posts
    2

    Post Complex IF AND OR function formula

    OK so I have a lot to explain but here is what I need

    Please see attached file!

    So I need Excel to
    1) calculate the difference between "Price Ordered" and "Price received" ... I would like the number to NOT be a negative or change color I just want the plain number (whether it's more or less)
    2) automatically fill in "D4" with "Over" or "Short" ... if it is equal, just leave it blank
    I have gotten this far on my own but I think the main problem is that I am not doing the formula in the correct order
    3) the "Price Ordered" will ALWAYS be on the sheet, we will enter the Price Received weekly since it changes .... the way I did it, the difference will ALWAYS shows "$10" and "Short" in C4 and D4...my question is, how can I leave C4 and D4 Blank until I fill in B4? and when I do fill in B4 how can I make it say "Over", "Short" or leave it blank if it is equal to A4?

    I have attached a file and that's what I would like for it to look like but I just need the formulas to do so

    I really hope this makes sense to somebody! I have been cracking my head over this for DAYS!

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Complex IF AND OR function formula

    Okay use this for difference-
    Please Login or Register  to view this content.
    and this for over and short result-
    Please Login or Register  to view this content.
    Check attached for an example!

    Hope that Helps!!
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Complex IF AND OR function formula

    Welcome to the site.
    try this
    C4 = IF(B4="","",B4-A4
    D4 = =IF(B4="","",IF(B4>A4,"over","short"))

    You can add another nested if to D4 if you really want to capture the case when A4 and B4 are equal
    Happy with my advice? Click on the * reputation button below

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Complex IF AND OR function formula

    Another Try

    C2=ABS(B4-A4)
    D4=IF(B4>A4,"Over",IF(B4<A4,"Short",""))
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    01-22-2016
    Location
    USA
    MS-Off Ver
    10
    Posts
    2
    This is awesome!!! Thank you so much!!

    One more thing... what would I have to add if the difference is ZERO? I don't want a Zero there, I would just like for it to be blank ... help?



    Quote Originally Posted by Crooza View Post
    Welcome to the site.
    try this
    C4 = IF(B4="","",B4-A4
    D4 = =IF(B4="","",IF(B4>A4,"over","short"))

    You can add another nested if to D4 if you really want to capture the case when A4 and B4 are equal

  6. #6
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Complex IF AND OR function formula

    please check my solution above .

  7. #7
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Complex IF AND OR function formula

    Quote Originally Posted by Reneehin23 View Post
    This is awesome!!! Thank you so much!!

    One more thing... what would I have to add if the difference is ZERO? I don't want a Zero there, I would just like for it to be blank ... help?
    Try this small change

    C4 = IF(B4="","",if(b4=A4,"",abs(B4-A4)))
    D4 = =IF(B4="","",IF(B4>A4,"over",if(B4<A4,"short","")))

+ 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. Tutoring: Complex Formula Structure Involving the IF Function
    By lila12 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-12-2015, 11:31 AM
  2. Creating a user defined function based on a complex worksheet formula
    By Atul Maskara in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-24-2014, 09:36 AM
  3. Adding IF function to existing (complex) Formula
    By NDRYNWA in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-24-2013, 06:56 AM
  4. [SOLVED] building a complex formula with the IF statement and Mround function
    By echy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-04-2013, 12:24 PM
  5. Creating a function to simplify a more complex function
    By mk74 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-29-2011, 08:43 AM
  6. [SOLVED] complex excel formula Array how do I convert it to a vba Function
    By Rob in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-10-2006, 02:10 PM

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