+ Reply to Thread
Results 1 to 7 of 7

Thread: Nested IF function? If X & IF Y, THEN = Z

  1. #1
    Registered User
    Join Date
    12-20-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    14

    Nested IF function? If X & IF Y, THEN = Z

    Hi all,

    I need some help with a IF function?

    I have a database which is populated from a form for booking a computer desk. So eachtime a booking is made, it adds to the DB. So all the old booking will still be there.

    Columns in Database:

    Desk (Column A)
    Date Booked FROM (J)
    Date Booked TO (K)
    STATUS (O) = "Free", "Booked" or "Free Today but future booking"
    OLD BOOKING = "Y" or "N" (i.e. has the Date Booked TO past)

    Columns in Summary:
    Desk (Column A) ..... 1-42
    STATUS (B) = need to work this out

    So I need a formula to search column A looking for the corresponding Desk Number, that is not an old booking = to give the status.


    Hopefully this makes sense & will be simple for you guys & girls!

    Thanks
    Last edited by jammy78; 01-16-2012 at 05:14 AM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Nested IF function? If X & IF Y, THEN = Z

    Try something like:

    =INDEX(Sheet1!$O$2:$O$100,MATCH(1,INDEX((Sheet1!$A$2:$A$100=A2)*($P$2:$P$100="N"),0),0))

    where Sheet1 is database sheet, and range goes to row 100... and P2:P100 is the "OLD Booking" column

    adjust as necessary and copy down.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    12-20-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Nested IF function? If X & IF Y, THEN = Z

    Quote Originally Posted by NBVC View Post
    Try something like:

    =INDEX(Sheet1!$O$2:$O$100,MATCH(1,INDEX((Sheet1!$A$2:$A$100=A2)*($P$2:$P$100="N"),0),0))

    where Sheet1 is database sheet, and range goes to row 100... and P2:P100 is the "OLD Booking" column

    adjust as necessary and copy down.
    Thanks for the quick reply!!!!

    I'm getting #N/A? So I need to use the INDEX & MATCH Functions....... I'll see if I can work it out!?

  4. #4
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Nested IF function? If X & IF Y, THEN = Z

    If you need further help, post sample workbook.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    12-20-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Nested IF function? If X & IF Y, THEN = Z

    Here's a sample of the spreadsheet......
    Attached Files Attached Files

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Nested IF function? If X & IF Y, THEN = Z

    The formula would be:

    =INDEX(Database!$O$2:$O$23,MATCH(1,INDEX((Database!$A$2:$A$23=A2)*(Database!$P$2:$P$23="N"),0),0))

    this gives #N/A if there is no match for the Desk # at the same time having a "N" in column P....
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Registered User
    Join Date
    12-20-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Nested IF function? If X & IF Y, THEN = Z

    Quote Originally Posted by NBVC View Post
    The formula would be:

    =INDEX(Database!$O$2:$O$23,MATCH(1,INDEX((Database!$A$2:$A$23=A2)*(Database!$P$2:$P$23="N"),0),0))

    this gives #N/A if there is no match for the Desk # at the same time having a "N" in column P....
    Thanks for you help, it's much appreciated!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0