+ Reply to Thread
Results 1 to 3 of 3

Help with IF formula - too many ANDs and ORs for my liking!

  1. #1
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    Help with IF formula - too many ANDs and ORs for my liking!

    Hi All,

    I've officially given up. Can anyone see the problem with the formulas contained in Cell D30 on the attached. What I'm trying to achieve is the below - I've tried different permutations myself and the closest I've got is the formula in Cell D30, so I'll use this as an example:

    - First rule: If the date in Column A on row 30 is not greater than the date in cell A2, the cell D30 should show zero
    - Second rule: If the date in D20 is greater than or equal to the date in A30 AND is also less than the date in A31, then;
    - If the date in A30 is greater or equal to the date in D12 AND less than or equal to the date in D14 (i.e. if A30 falls within the date range of D12 and D14), then the result should be D17 plus D19 but;
    - If the date in A30 is less than the date in D12 OR greater than the date in D14 (i.e. if A30 falls outside the date range of D12 and D14), then the result should be D17 but;
    - Third rule: if the date in D20 is less than A30 or greater than A31 (i.e. falls outside the date range of A30 and A31) then:
    - If A30 is greater than or equal to D12 AND less than or equal to D14, then the result should be D19 else;
    - The result should be zero
    Attached Files Attached Files
    Last edited by STUARTXL; 02-22-2016 at 04:37 PM. Reason: Spelling Mistake

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Help with IF formula - too many ANDs and ORs for my liking!

    Hi Stuart

    Here is my effort, it works but I haven't tested it properly
    It works in the order you described it

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-30-2014
    Location
    Pittsburgh,PA
    MS-Off Ver
    Office 2010, Home Student 2013
    Posts
    62

    Re: Help with IF formula - too many ANDs and ORs for my liking!

    Parsing your text statements, I came up with this.

    Pseudocode
    Please Login or Register  to view this content.
    When using Booleans, multiplication is equivalent to AND(), addition is equivalent to OR(). When trying to explain your statements to myself, I saw no OR() conditions. This is what I came up with:
    Please Login or Register  to view this content.

+ 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] INDEX_MATCH not reponding to my liking. Need help
    By saifsawafi in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 10-09-2015, 10:44 AM
  2. if and ands
    By sophia_1234 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2014, 03:01 PM
  3. Formula needing help with. (IFs, ANDs, ORs)
    By stacey52891 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2013, 10:37 AM
  4. [SOLVED] Excel Formula - Lots of ORs and ANDs
    By nikolasm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2013, 04:48 PM
  5. Replies: 0
    Last Post: 09-01-2010, 12:40 PM
  6. Autoselection of Spreadsheet for liking
    By Spreadsheet Linking Flexibility in forum Excel General
    Replies: 0
    Last Post: 05-29-2006, 02:25 PM
  7. formula error, vba not liking commas
    By Spike in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2006, 06:40 AM

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