+ Reply to Thread
Results 1 to 11 of 11

formulas placed in a cell - showing different results based on multi conditions.

  1. #1
    Forum Contributor
    Join Date
    06-24-2004
    MS-Off Ver
    Excel 2013 Pro Plus
    Posts
    122

    formulas placed in a cell - showing different results based on multi conditions.

    Hello friends, hope you are all well!
    The calendar attachment here has 2 sheets: 1. “Availability”. And 2. “Car Reservation”.

    I want to place formulas in sheet “Availability” cells F14:T16. The result of the formula will show a number between 1 to 9, based on the results. And the conditional formatting will color the cell based on the results (between 1 to 9).
    OK the formula will:
    a. Will go to 'Car Reservation' and look in $F$2:$F$995 and if it is <= than date in “Availability” F$12.
    b. Will go to 'Car Reservation' and look in $G$2:$G$995 and if it is >= than date in “Availability” F$12.
    c. Will go to 'Car Reservation' and look in !$H$2:$H$995 and if it = $C14 in sheet “Availability”.
    d. And if 'Car Reservation' and look in $i$2:$i$995 = VACATION & COMITEE, then the result will be 7.

    And so on, like the 'row 3' results and conditions of sheet “Availability”. so the cell will have

    I really appreciate your kind help and thank you very much in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formulas placed in a cell - showing different results based on multi conditions.

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



    you could use sumifs too instead of sumpropduct
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Contributor
    Join Date
    06-24-2004
    MS-Off Ver
    Excel 2013 Pro Plus
    Posts
    122

    Re: formulas placed in a cell - showing different results based on multi conditions.

    Hi! and thanks a lot! I made some adjustments, but now facing a new related problem: the formula is in F14:

    {=IF(SUM((('Car Reservation'!$H$2:$H$2000=C14)*('Car Reservation'!$F$2:$F$2000<=F$12)*('Car Reservation'!$G$2:$G$2000>=F$12)*('Car Reservation'!$I$2:$I$2000={"vacation","Comitee","Career"})))>=3,7,IF(SUM((('Car Reservation'!$H$2:$H$2000=C14)*('Car Reservation'!$F$2:$F$2000<=F$12)*('Car Reservation'!$G$2:$G$2000>=F$12)*('Car Reservation'!$I$2:$I$2000={"comitee","Career"})))>=2,6,IF(SUM((('Car Reservation'!$H$2:$H$2000=C14)*('Car Reservation'!$F$2:$F$2000<=F$12)*('Car Reservation'!$G$2:$G$2000>=F$12)*('Car Reservation'!$I$2:$I$2000={"comitee","vacation"})))>=2,5,IF(SUM((('Car Reservation'!$H$2:$H$2000=C14)*('Car Reservation'!$F$2:$F$2000<=F$12)*('Car Reservation'!$G$2:$G$2000>=F$12)*('Car Reservation'!$I$2:$I$2000={"vacation","Career"})))>=2,4,1))))}

    The result that I am getting is ‘7’ which is wrong, please look at the data base ('Car Reservation') you will see that {"vacation","Comitee","Career"} do not exist. So why get 7?

    Your time and efforts are truly appreciated!

  4. #4
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formulas placed in a cell - showing different results based on multi conditions.

    {"vacation","Comitee","Career"}

    Above stands for any out of these
    in your data Comitee and career stands for 3 times so you are getting that results.

  5. #5
    Forum Contributor
    Join Date
    06-24-2004
    MS-Off Ver
    Excel 2013 Pro Plus
    Posts
    122

    Re: formulas placed in a cell - showing different results based on multi conditions.

    great, is there a way to place the above three in a AND formula within that formula please?

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formulas placed in a cell - showing different results based on multi conditions.

    you could use something like below

    =SUMPRODUCT(--(COUNTIFS('Car Reservation'!$H$2:$H$2000,C14,'Car Reservation'!$F$2:$F$2000,"<="&F$12,'Car Reservation'!$G$2:$G$2000,">="&F$12,'Car Reservation'!$I$2:$I$2000,{"vacation","Comitee","Career"})>=1))

    above will give you 2 as career and comitee is a match
    Last edited by hemesh; 02-16-2016 at 12:29 PM.

  7. #7
    Forum Contributor
    Join Date
    06-24-2004
    MS-Off Ver
    Excel 2013 Pro Plus
    Posts
    122

    Re: formulas placed in a cell - showing different results based on multi conditions.

    thank you for the reply, I actually want to show a different color if there is conflicting scheduling, that is why I am wondering if you can help me create an AND function within the formula please?
    i.e. if the database all conditions are met column I (TYPE) has a triple booking of a vacation, Career, and Comitee; then I display a different color to show that there is a conflict.

  8. #8
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formulas placed in a cell - showing different results based on multi conditions.

    with above formula, I think you can adjust all your conditions

  9. #9
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formulas placed in a cell - showing different results based on multi conditions.

    =SUMPRODUCT(--(COUNTIFS('Car Reservation'!$H$2:$H$2000,C14,'Car Reservation'!$F$2:$F$2000,"<="&F$12,'Car Reservation'!$G$2:$G$2000,">="&F$12,'Car Reservation'!$I$2:$I$2000,{"vacation","Comitee","Career"})>=1))=3

    change 3 to 2 to check if its meeting two conditions

  10. #10
    Forum Contributor
    Join Date
    06-24-2004
    MS-Off Ver
    Excel 2013 Pro Plus
    Posts
    122

    Re: formulas placed in a cell - showing different results based on multi conditions.

    very cool! thanks!

  11. #11
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: formulas placed in a cell - showing different results based on multi conditions.

    if that takes care of your original question please go to thread tool and mark thread as solved

+ 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. all formulas showing zero results in excel sheet
    By shilpa bvs in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2013, 08:34 AM
  2. [SOLVED] Average results based on multiple conditions and by month
    By Tanya_ in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-14-2013, 06:41 PM
  3. Updating multiple cells based a master sheet and showing results in a User Form
    By katkins0429 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2013, 05:18 AM
  4. Replies: 3
    Last Post: 07-25-2012, 07:54 AM
  5. [SOLVED] Returning only unique results based on multiple conditions
    By Dickens153 in forum Excel General
    Replies: 5
    Last Post: 03-29-2012, 12:29 PM
  6. VBA to extract results based on two conditions
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2011, 03:24 PM
  7. Replies: 5
    Last Post: 08-26-2009, 10:21 AM
  8. Formulas not showing results
    By sonar in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 09-06-2005, 09:05 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