+ Reply to Thread
Results 1 to 5 of 5

Nested Ifs/Ands and some tough to figure out variables - Would appreciate your input

  1. #1
    Registered User
    Join Date
    02-17-2018
    Location
    Los Angeles, CA
    MS-Off Ver
    2013
    Posts
    8

    Nested Ifs/Ands and some tough to figure out variables - Would appreciate your input

    I have been putting together several multi-worksheet workbooks, with multiple formulas running between the sheets. I am over my head most of the time, but have been able to figure out most of what I need by trial and error, and searching the web.

    I've hit a roadblock tonight trying to add some new functionality with (what I consider) a complicated formula, that has been working fine for quite some time.

    This is the formula that is working fine...
    =IF(AND(I$1>=Staff!$N12,OR(I$1 <= Staff!$O12,ISBLANK(Staff!$O12))),(Staff!$H12*Setup!$C$26)*H12,0)

    It checks a start date (col N) and end date (col O) on the "staff" tab, and then checking those dates with cell i1...and if all is well it makes a simple calculation. Again, this works perfectly.

    The new functionality that I am trying to add is to check another cell value (Staff!B10) for a text string...so something like If(Staff!B10="CAFS")...and if the result is true, it runs the above formula...and if the result is something other than the noted text string, I simply want to run the same formula with a small change (instead of Setup!$C$26 it will simply be Setup!$C$27).

    I have tried several things including the two samples below...both of which simply return a "False" value.
    =IF(Staff!B5<>"CAFS",(AND(I$1>=Staff!$N6,OR(I$1<=Staff!$O6,ISBLANK(Staff!$O6))))*(Staff!$H6*Setup!$C$26)*H6,IF(Staff!B5="CAFS",(AND(I$1>=Staff!$N6,OR(I$1<=Staff!$O6,ISBLANK(Staff!$O6))))*(Staff!$H6*Setup!$K$26)*H6))

    =IF(Staff!B10="CAFS", then(AND(I$1>=Staff!$N10,OR(I$1 <= Staff!$O10,ISBLANK(Staff!$O10))),(Staff!$H10*Setup!$K$26)*H10, IF(AND(I$1>=Staff!$N10,OR(I$1 <= Staff!$O10,ISBLANK(Staff!$O10))),(Staff!$H10*Setup!$C$26)*H10,0)))

    I apologize if I am doing a poor job of trying to explain my issue, but as I noted above, I'm over my head (and getting pretty frustrated). Any assistance would be greatly assisted.

    Thanks,
    Bill

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Nested Ifs/Ands and some tough to figure out variables - Would appreciate your input

    Hi, welcome to the forum

    Always hard to follow on with involved formulae like that

    If you need to add another test that will determine HOW the actual calc will run - rather than determining OF the calc will run, put the test IN the calc part, itself. You have the switch working for IF the formula fires, so dont mess with that part.

    Im thinking something like...
    (Staff!$H12*Setup!$C$26)*if(something=something, H12, A5+5)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Nested Ifs/Ands and some tough to figure out variables - Would appreciate your input

    Hmm try this and see if it work.

    =IF(Staff!B10="CAFS", IF(AND(I$1>=Staff!$N10,OR(I$1 <= Staff!$O10,ISBLANK(Staff!$O10))),(Staff!$H10*Setup!$K$26)*H10), IF(AND(I$1>=Staff!$N10,OR(I$1 <= Staff!$O10,ISBLANK(Staff!$O10))),(Staff!$H10*Setup!$C$26)*H10,0))

  4. #4
    Registered User
    Join Date
    02-17-2018
    Location
    Los Angeles, CA
    MS-Off Ver
    2013
    Posts
    8

    Re: Nested Ifs/Ands and some tough to figure out variables - Would appreciate your input

    Thanks you so much Finalazy! Your suggested formula worked perfectly! You saved me many more hours of frustration, so I really appreciate your quick response!

  5. #5
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Nested Ifs/Ands and some tough to figure out variables - Would appreciate your input

    Quote Originally Posted by westsidebill View Post
    Thanks you so much Finalazy! Your suggested formula worked perfectly! You saved me many more hours of frustration, so I really appreciate your quick response!
    You are welcome. In fact you already got the formula just that you close the bracket in a wrong order. Glad it helps and please help to change the topic to solve =)

+ 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. Hoping not to tough to figure out.
    By Venturahighway in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-23-2016, 01:29 PM
  2. [SOLVED] finding an output from 5 variables in an array using exterior input user variables
    By Allsort in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2013, 11:16 AM
  3. Nested IF function, can't figure out the formula
    By gibby82 in forum Excel General
    Replies: 2
    Last Post: 02-01-2012, 01:35 PM
  4. Nested Ifs, 3 ANDS condition
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2011, 07:04 PM
  5. can't figure out LOOKUP with 2 variables
    By LTUser54 in forum Excel General
    Replies: 1
    Last Post: 05-30-2006, 02:41 PM
  6. [SOLVED] Multiple Variables in a Commission Structure...a tough one!!!
    By Oriana G in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-21-2006, 03:55 PM
  7. nested:NEED HELP! Cannot figure out complex function
    By Rowan in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 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