+ Reply to Thread
Results 1 to 11 of 11

Using IF and AND for multiple criterias

  1. #1
    Registered User
    Join Date
    08-26-2019
    Location
    Thailand
    MS-Off Ver
    2016
    Posts
    9

    Using IF and AND for multiple criterias

    Untitled.png

    Hi i wanted some help with the IF function. In the Column J "Criteria" -

    I want it to Check IF column A "Order Type" is STAT, Routine or Home-Med
    IF column A is STAT and Column H is less than or equal to 5 mins - Column I says MET otherwise FAIL
    IF column A is Routine and Column H is less than or equal to 15 mins - Column I says MET otherwise FAIL
    IF column A is Home-med and Column H is less than or equal to 60 mins - Column I says MET otherwise FAIL


    In Columns B - E there are no formulas i just used the Time Format HH:MM:SS
    In Column E =
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In Column F =
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In Column H =
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    I tried using the basic formula in Column I =
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    it returns the error value #NAME?

    Any help would really be appreciated

    Thank you
    Last edited by sorngiggle; 08-26-2019 at 04:48 AM.

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Using IF and AND for multiple criterias

    In H2 you've got text "4 mins" so you have to agree that is not ="<=5".
    Maybe instead of:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    you can use formula which you are using in H, I mean:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    08-26-2019
    Location
    Thailand
    MS-Off Ver
    2016
    Posts
    9

    Re: Using IF and AND for multiple criterias

    This one works!!
    Last edited by AliGW; 08-27-2019 at 01:29 AM. Reason: Please don't quote unnecessarily!

  4. #4
    Registered User
    Join Date
    08-26-2019
    Location
    Thailand
    MS-Off Ver
    2016
    Posts
    9

    Re: Using IF and AND for multiple criterias

    Can i pick ur brain a little more?

    Attachment 638845

    It should actually Show 61 mins but it shows 1 mins - i think it is taking into account only the minutes and not the hours - How can i fix it


    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I can actually use the above code for Column H it returns the value "01 hrs, 1 mins"




    But, How do i change this formula to get my required criterias
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thanks alot
    Last edited by sorngiggle; 08-26-2019 at 05:33 AM.

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Using IF and AND for multiple criterias

    Attachment can't be download.
    Try once more.

  6. #6
    Registered User
    Join Date
    08-26-2019
    Location
    Thailand
    MS-Off Ver
    2016
    Posts
    9

    Re: Using IF and AND for multiple criterias

    Quote Originally Posted by KOKOSEK View Post
    Attachment can't be download.
    Try once more.
    Attachment 638846

    Thank you and here u go

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Using IF and AND for multiple criterias

    Still wrong.
    Go this way:
    Go advanced -> Manage attachments (below main post window) -> on new page on top choose file, Upload - on right, then Close window and Post.

  8. #8
    Registered User
    Join Date
    08-26-2019
    Location
    Thailand
    MS-Off Ver
    2016
    Posts
    9

    Re: Using IF and AND for multiple criterias

    Ok, I will try it that way

    In Column H =
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    In Column I =
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In Column J =
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by sorngiggle; 08-26-2019 at 05:50 AM.

  9. #9
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: Using IF and AND for multiple criterias

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    STAT
    15:30:00
    15:32:00
    15:33:00
    15:35:00
    1 mins 5 mins MET
    2
    Home-Med
    16:00:00
    16:15:00
    16:25:00
    17:01:00
    10 mins 61 mins FAIL


    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    STAT
    15:30:00
    15:32:00
    15:33:00
    15:35:00
    =TEXT(D1-C1,"[m]")& " mins" =TEXT(E1-B1,"[m]")& " mins" =IF(OR(AND(A1="STAT",(MINUTE(E1-B1))<=5),AND(A1="Routine",(MINUTE(E1-B1))<=15),AND(A1="Home-med",(MINUTE(E1-B1))<=TIMEVALUE("1:00:00"))),"MET","") =IF(OR(AND(A1="STAT",(MINUTE(E1-B1))>5),AND(A1="Routine",(MINUTE(E1-B1))>15),AND(A1="Home-med",(MINUTE(E1-B1))>=TIMEVALUE("1:00:00"))),"FAIL","")
    2
    Home-Med
    16:00:00
    16:15:00
    16:25:00
    17:01:00
    =TEXT(D2-C2,"[m]")& " mins" =TEXT(E2-B2,"[m]")& " mins" =IF(OR(AND(A2="STAT",(MINUTE(E2-B2))<=5),AND(A2="Routine",(MINUTE(E2-B2))<=15),AND(A2="Home-med",(MINUTE(E2-B2))<=TIMEVALUE("1:00:00"))),"MET","") =IF(OR(AND(A2="STAT",(MINUTE(E2-B2))>5),AND(A2="Routine",(MINUTE(E2-B2))>15),AND(A2="Home-med",(MINUTE(E2-B2))>=TIMEVALUE("1:00:00"))),"FAIL","")
    Sheet: Sheet1

    5 minutes and 15 minutes you can change for TIMEVALUE("00:00:05") and TIMEVALUE("00:15:00")

  10. #10
    Registered User
    Join Date
    08-26-2019
    Location
    Thailand
    MS-Off Ver
    2016
    Posts
    9

    Re: Using IF and AND for multiple criterias

    It doesn't work i tried using
    For Criteria Met
    Formula: copy to clipboard
    Please Login or Register  to view this content.




    For Criteria Failed
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    They return no values
    Attached Images Attached Images
    Last edited by AliGW; 08-27-2019 at 01:29 AM. Reason: Please don't quote unnecessarily!

  11. #11
    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,933

    Re: Using IF and AND for multiple criterias

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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

+ 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. Replies: 6
    Last Post: 02-23-2018, 07:09 PM
  2. [SOLVED] SUMPRODUCT with multiple criterias, multiple search on same column and with wild card
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-25-2017, 07:17 PM
  3. Replies: 0
    Last Post: 02-02-2014, 08:42 AM
  4. [SOLVED] Populate Values in Multiple List Boxes based on Multiple Criterias
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-09-2013, 11:39 AM
  5. [SOLVED] Summing value on a column in multiple criterias in multiple sheet
    By radicrains in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2013, 11:51 PM
  6. [SOLVED] Summing value on a column in multiple criterias in multiple sheet
    By radicrains in forum Excel General
    Replies: 2
    Last Post: 02-12-2013, 11:51 PM
  7. Replies: 2
    Last Post: 07-12-2010, 01:17 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