Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default SUMPRODUCT with two valid criteria

Hi, Thanks in advance for your help.

I am creating a calendar to see time availability from a huge table that
list the room, the date, the day, and the time. We rent our facilities, so I
need to know which events are ours and which one are for outsider.
PROBLEM: I found out that if there is an event planned at the same time in
the same day, the formula retrieves a blank space, so it shows as available.
I'm awared that this is a problem of my database, but is there a way than
once the criteria finds one slot occupied, ignore the other events duplicated?

This is the expression (Sorry!):

=IF(SUMPRODUCT(--(Sheet1!$A$2:$A$2500=Room),--(BegDate=Sheet1!$C$2:$C$2500),--(EndDate<=Sheet1!$D$2:$D$2500),--(Day=Sheet1!$E$2:$E$2500))),--(Time=Sheet1!$G$2:$G$2500),--(Sheet1!$I$2:$I$2500))=1,"Company",IF(SUMPRODUCT(--(Sheet1!$A$2:$A$2500=Room),--(BegDate=Sheet1!$C$2:$C$2500),--(EndDate<=Sheet1!$D$2:$D$2500),--(Day=Sheet1!$E$2:$E$2500))),--(Time=Sheet1!$G$2:$G$2500),--(Sheet1!$I$2:$I$2500))=2,"Outside",""))

My calendar looks like this:
"Room" 4/5 4/6 4/7 4/8
4/9.............
M T W H
F................
Morning
Afternoon


THANKS MUCH!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default SUMPRODUCT with two valid criteria

This is the expression

I'm not sure what you're asking but that formula can be reduced a bit. It
looks like all you're interested in is a result of either 1 or 2. Anything
else returns a blank.

You don't need to use both SUMPRODUCTs.

All on one line:

=LOOKUP(SUMPRODUCT(
--(Sheet1!$A$2:$A$2500=Room),
--(BegDate=Sheet1!$C$2:$C$2500),
--(EndDate<=Sheet1!$D$2:$D$2500),
--(Day=Sheet1!$E$2:$E$2500),
--(Time=Sheet1!$G$2:$G$2500),
Sheet1!$I$2:$I$2500),{0;1;2;3},
{"";"Company";"Outside";""})

--
Biff
Microsoft Excel MVP


"Lily" wrote in message
...
Hi, Thanks in advance for your help.

I am creating a calendar to see time availability from a huge table that
list the room, the date, the day, and the time. We rent our facilities, so
I
need to know which events are ours and which one are for outsider.
PROBLEM: I found out that if there is an event planned at the same time in
the same day, the formula retrieves a blank space, so it shows as
available.
I'm awared that this is a problem of my database, but is there a way than
once the criteria finds one slot occupied, ignore the other events
duplicated?

This is the expression (Sorry!):

=IF(SUMPRODUCT(--(Sheet1!$A$2:$A$2500=Room),--(BegDate=Sheet1!$C$2:$C$2500),--(EndDate<=Sheet1!$D$2:$D$2500),--(Day=Sheet1!$E$2:$E$2500))),--(Time=Sheet1!$G$2:$G$2500),--(Sheet1!$I$2:$I$2500))=1,"Company",IF(SUMPRODUCT(--(Sheet1!$A$2:$A$2500=Room),--(BegDate=Sheet1!$C$2:$C$2500),--(EndDate<=Sheet1!$D$2:$D$2500),--(Day=Sheet1!$E$2:$E$2500))),--(Time=Sheet1!$G$2:$G$2500),--(Sheet1!$I$2:$I$2500))=2,"Outside",""))

My calendar looks like this:
"Room" 4/5 4/6 4/7 4/8
4/9.............
M T W H
F................
Morning
Afternoon


THANKS MUCH!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUMPRODUCT with 3 criteria Kit Excel Discussion (Misc queries) 7 July 13th 09 01:54 PM
Sumproduct criteria Eric Excel Worksheet Functions 6 March 5th 09 04:59 AM
SUMPRODUCT using more than 2 criteria? Max Excel Worksheet Functions 0 August 17th 07 02:23 AM
SUMPRODUCT using more than 2 criteria? Max Excel Worksheet Functions 0 August 17th 07 01:45 AM
SUMPRODUCT with 3 criteria Kierano Excel Discussion (Misc queries) 1 October 16th 06 05:16 PM


All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"