+ Reply to Thread
Results 1 to 11 of 11

How do i make Multiple If & 1 And Statement

  1. #1
    Registered User
    Join Date
    01-29-2016
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    12

    How do i make Multiple If & 1 And Statement

    So i have looked over and over for a proper answer on this, but I am having a hard time piecing everyone else's formula together into mine, if Someone could help me with the formula it would be much appreciated.
    Basically its a form that says weather someone is suspended or on Leave of Absence or neither and relays it to our roster.
    E F G H I
    LOA / Suspended Your Name Their Name Start Date End Date

    Currently the Formula i have is
    Please Login or Register  to view this content.
    (If todays date is between start and end date show end date)
    Which does a okay job at telling me if they are currently on LOA, and returns the ending date.
    Now im adding suspended to this form, so i need to Add
    If E = "LOA" Then IF(AND(TODAY()>=H2,TODAY()<=I2),"LOA"I2,"" (If E says LOA Then check if Todays date is between start and end and if it is show "LOA" End Date)
    Otherwise see if
    If E = "Suspended Then IF(AND(TODAY()>=H2,TODAY()<=I2),"SUSPENDED"I2,"" (If E says Suspended Then check if Todays date is between start and end and if it is show "Suspended" End Date

    I understand the code may need to be written but i can't seem to find a method in doing this.
    Thank you

  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,969

    Re: How do i make Multiple If & 1 And Statement

    You are on the right track

    If those are the ONLY 2 codes you are testing for....
    =IF(AND(TODAY()>=H2,TODAY()<=I2),IF(E2="LOA"I2,"Suspended"),"")
    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
    Registered User
    Join Date
    01-29-2016
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    12

    Re: How do i make Multiple If & 1 And Statement

    I tried something similar and it didn't work, unfortunately neither did this it gives me a formula phase error, thanks for the try though

  4. #4
    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,969

    Re: How do i make Multiple If & 1 And Statement

    what is a formula phase error? Never heard of that 1

  5. #5
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: How do i make Multiple If & 1 And Statement

    Hi Ford,

    I think you've probably missed the & sign:
    IF(E2="LOA"I2

    IF(E2="LOA"&I2


    so the formula would be:
    =IF(E2= "LOA",IF(AND(TODAY()>=H2,TODAY()<=I2),"LOA"&I2,IF(E2= "SUSPENDED",IF(AND(TODAY()>=H2,TODAY()<=I2),"SUSPENDED"&I2,"..."))))

    but it will show the date in general format, we have to include a text fuction:
    =IF(E2= "LOA",IF(AND(TODAY()>=H2,TODAY()<=I2),"LOA"&TEXT(I2," dd-mm-yy"),IF(E2= "SUSPENDED",IF(AND(TODAY()>=H2,TODAY()<=I2),"SUSPENDED"&TEXT(I2," dd-mm-yy"),"..."))))

    @Chia4, can you please explain your requirement with sample data and desire output?

    Blessing
    Khalid

  6. #6
    Registered User
    Join Date
    01-29-2016
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    12

    Re: How do i make Multiple If & 1 And Statement

    That actually works khal thanks!.
    And when it display "Text" and date i then run a index search with a list of names and once that is done it imports it to another document with the name and dates.
    Now my problem is how to make 2 Index & Match statements in 1 cell. im stuck here.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,598

    Re: How do i make Multiple If & 1 And Statement

    Post a sample file not image) showing expected outcomes.

  8. #8
    Registered User
    Join Date
    01-29-2016
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    12

    Re: How do i make Multiple If & 1 And Statement

    Alright so here's the link, [l
    ink]https://docs.google.com/spreadsheets/d/1FLSvgT8yfCE7l2V4nLE7ZutWElA8VuILQyZo_6S-PaU/edit?usp=sharing[/link]
    Basically there is a tab for "LOA Responses" There is a google Form that submits information here

    Then there is a Suspension Responses, There is also another google form that submits information there.

    Then there's the summary.......
    Basically there's the Name List And Position, The Column "C" is a Index & Match for column K & S
    And if they are filled will that person's name it will fill in that info from that column.

    I can get it to work for 1 column but im not sure how to match 2 columns. my attempt is C3 &C5
    C17 is a working Example of it Matching 1 Column and working

    Of course this is just a copy so feel free to edit anything if you need to test it

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,598

    Re: How do i make Multiple If & 1 And Statement

    Completely confused as what you expect to get in but try this ...

    =IFERROR(INDEX($K$1:$K1001,MATCH(A5,$G$1:$G1001,0)),IFERROR(INDEX($S$1:$S1001,MATCH(A5,$N$1:$N1001,0)),""))

  10. #10
    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,969

    Re: How do i make Multiple If & 1 And Statement

    Please upload your file to the forum. Not all members are able - or willing - to access file-hosting sites

  11. #11
    Registered User
    Join Date
    01-29-2016
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    12

    Re: How do i make Multiple If & 1 And Statement

    Quote Originally Posted by JohnTopley View Post
    Completely confused as what you expect to get in but try this ...

    =IFERROR(INDEX($K$1:$K1001,MATCH(A5,$G$1:$G1001,0)),IFERROR(INDEX($S$1:$S1001,MATCH(A5,$N$1:$N1001,0)),""))
    You Got it! Awesome, Thank you so much, i know it was confusing

+ 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: 2
    Last Post: 07-09-2015, 04:25 PM
  2. [SOLVED] Need IF statement or Macro to make decision based on multiple criteria
    By weddica in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-25-2013, 03:30 PM
  3. How do I make an if statement
    By cassy09 in forum Excel General
    Replies: 2
    Last Post: 04-23-2012, 10:03 PM
  4. Best way to make a long if statement?
    By mike12345 in forum Excel General
    Replies: 3
    Last Post: 12-16-2011, 02:53 PM
  5. make:IF statement
    By dubes40 in forum Excel General
    Replies: 3
    Last Post: 01-28-2011, 04:32 PM
  6. Need IF statement that can make 0 - 8 = 0
    By jonvanwyk in forum Excel General
    Replies: 2
    Last Post: 06-29-2010, 11:47 AM
  7. Replies: 1
    Last Post: 06-30-2006, 08:35 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