0

I have a field in my excel spreadsheet that depends on several different fields to determine the calculation that should be made. I think I have my formula correct but I am not getting the appropriate responses so I know there must be something I am missing. Let me start by summarizing what I am attempting to do.

If D5=2, then I need to verify if $AI$12-AB14>(3/24) and return a T if it is or leave the field blank if not. Alternatively, if D5=1, then I have to also verify that Y14=Y and Z14=Y, and finally $AC$12-AA14>(3/24) and return a T if so, or leave the field blank if not.

(The reference to 3/24 is required as I am performing time calculations from data entry fields pulling from a userform)

What I am receiving for a response is 'True'. That is not an option so I suspect it is returning the result of a specific logical statement? Below is my formula:

=IF(AND(D5="2",$AI$12-AB14>(3/24),),"T","") 

=IF(AND(D5="1",Y14="Y",Z14="Y",$AC$12-AA14>(3/24),),"T","")
9
  • Please edit your question title to something meaningful. Can someone help me is not an acceptable question here, and Excel formula is indicated by the tags and isn't needed in the title. Your title should describe a problem or ask a question that contains enough information to be of use to a future reader here who is scanning through a list of search results trying to find an answer, and your current title does not provide that information. Thanks.
    – Ken White
    Commented Dec 15, 2019 at 23:12
  • You have comma after ...>(3/24) expression, why? This always returns a false for AND part.
    – basic
    Commented Dec 15, 2019 at 23:18
  • I changed that but I am still not getting a correct response. :( Please note, both lines are one formula. I was directed to edit my post and it separated these into separate lines... it almost looks like they are different formulas. :)
    – Kristen
    Commented Dec 15, 2019 at 23:24
  • Oh, that's one formula. And what are you waiting for? You compare two if expressions where both have the same false result, which in turn gives a true result. I.e. if(...,"T","")=if(...,"T","") => ""="" => True
    – basic
    Commented Dec 15, 2019 at 23:31
  • I want excel to determine, based on D5, which calculation to use? I've been working in VBA a lot and now that I'm out of VBA, I'm struggling trying to get Excel formulas to make sense to me again. D5 determines if this is an employee or volunteer and there are different rules for each.
    – Kristen
    Commented Dec 15, 2019 at 23:36

1 Answer 1

0

I can't insert an image in comments, so I'll reply. This simplified example shows how it works: enter image description here

And pay attention to D5 - are there really values 1 and 2 as text. If not, the quotation marks must be removed from the formula

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.