INDIRECT(ADDRESS within SUMPRODUCT

ImeoT

New Member
Joined
Nov 6, 2018
Messages
6
Hi everyone,

I am trying to replace part of a formula to make it more dynamic.

To do this, I am replacing $B$10 with INDIRECT(ADDRESS(ROW(D15)-MOD(ROW(D15)+4,7),COLUMN(D15)-MOD(COLUMN(D15)-2,3)))

Now, ADDRESS(ROW(D15)-MOD(ROW(D15)+4,7),COLUMN(D15)-MOD(COLUMN(D15)-2,3)) = $B$10.

But replacing $B$10 in my formula does not work well for me.

Original formula:
=ISNUMBER(SEARCH("*text*",INDEX(Schedule!$F$2:$F$9998,SUMPRODUCT(($B$10=Schedule!$B$2:$B$9998)*($A$15=Schedule!$C$2:$C$9998)*($D$15=Schedule!$E$2:$E$9998)*(ROW(Schedule!$F$2:$F$9998)-1)),0)))

Original result:
TRUE

New Formula:
=ISNUMBER(SEARCH("*text*",INDEX(Schedule!$F$2:$F$9998,SUMPRODUCT((INDIRECT(ADDRESS(ROW(D15)-MOD(ROW(D15)+4,7),COLUMN(D15)-MOD(COLUMN(D15)-2,3)))=Schedule!$B$2:$B$9998)*($A$15=Schedule!$C$2:$C$9998)*($D$15=Schedule!$E$2:$E$9998)*(ROW(Schedule!$F$2:$F$9998)-1)),0)))

New Result:
FALSE

I would greatly appreciate any help with this, as I am pulling my hair out on this one!
 
Thanks for explaining.


If I understand correctly, you would like to get something like this:



Excel 2013 32 bit
ABCDEFG
113/11/2018
24:00 PM
3Event A07/11/201807/11/201807/11/201808/11/201808/11/201808/11/2018
44:00 AMEvent XEvent XEvent XEvent XEvent XEvent X
58:00 AMEvent XEvent XEvent XEvent XEvent XEvent X
612:00 PMEvent XEvent XEvent XEvent XEvent XEvent X
74:00 PMEvent XEvent XEvent XEvent XEvent XEvent X
88:00 PMEvent XEvent XEvent XEvent XEvent XEvent X
912:00 AMEvent XEvent XEvent XEvent XEvent XEvent X
1012/11/201812/11/201812/11/201813/11/201813/11/201813/11/2018
114:00 AMEvent CEvent AEvent A
128:00 AMEvent CEvent AEvent A
1312:00 PMEvent CEvent AEvent A
144:00 PMEvent AEvent BEvent C
158:00 PMEvent CEvent AEvent A
1612:00 AMEvent CEvent AEvent A
Sheet1



Following this concept, if your whole "table" is presented in cells B3:P37, and your time slots are presented in cells A4:A37, then you can apply the following Conditional Formatting rules:


YELLOW fill color - will highlight the 7x3 rectangle which matches the input date present in cell A1.
Formula: =INDEX(B:B,ROUNDUP((ROW()-ROW(B$2))/7,0)*7-4,1)=$A$1
Applies to: =$B$3:$P$37


BLUE fill color - will highlight exactly one cell which matches the input date present in cell A1, time slot (cell A2) and Event name (cell A3).
Formula: =AND(INDEX(B:B,ROUNDUP((ROW()-ROW($A$2))/7,0)*7-ROW($A$4),1)=$A$1,$A3=$A$2,B3=$A$3)
Applies to: =$B$3:$P$37


However, please make sure that your BLUE Conditional Formatting rule is the first rule in the queue.

Let me know if this is what you're looking for.
 
Last edited:
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Sorry for the delay getting back to you on this - my computer has been acting up.

Your explanation makes sense, but I need it integrated in a formula that also finds the date, time & event.

My raw data is in Worksheets("Schedule"):

ABCDEFGHIJKL
1IDDateTime StartTime EndGameAttendeesAttendees #RepeatMinMaxLengthViability
225/11/20186:00 PM6:30 PMEvent AAlex11360h7m0sNo
335/11/20187:00 PM8:00 PMEvent BAlex, Bob23241h0m0sOK
445/11/20187:00 PM8:00 PMEvent ABob, Chloe28180h56m0sOK
559/11/20187:00 PM7:30 PMEvent CChloe, Alex21250h30m0sOK

<tbody>
</tbody>
Schedule

I want to change the font for each cell in the following calendar, where Alex is an Attendee for the event taking place at the specified date and time.

Excel 2013/2016
ABCDEFGHIJKLMNOP
1November 2018
2MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAY
329303112
45:00 PM
55:30 PM
66:00 PM
76:30 PM
87:00 PM
97:30 PM
1056789
115:00 PM
125:30 PM
136:00 PMEvent A
146:30 PM
157:00 PMEvent BEvent AEvent C
167:30 PM

<tbody>
</tbody>
November 2018

As mentioned before, there is some issue with the formula:
=ISNUMBER(SEARCH("*Alex*",INDEX(Schedule!$F$2:$F$999,SUMPRODUCT((INDIRECT(ADDRESS(ROWS(B$1:B3)-MOD(ROWS(B$1:B3)+4,7),COLUMNS($A3:B3)-MOD(COLUMNS($A3:B3)-2,3)))=Schedule!$B$2:$B$999)*($A3=Schedule!$C$2:$C$999)*(B3=Schedule!$E$2:$E$999)*(ROW(Schedule!$F$2:$F$999)-1)),0)))

Excel 2013/2016
B*C*D*E*F*G*H*I*J*
3TRUETRUETRUETRUETRUETRUETRUETRUETRUE
4FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
5TRUETRUETRUETRUETRUETRUETRUETRUETRUE
6FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
7FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
8FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
9FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
10FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
11FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
12FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
13TRUEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
14FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
15TRUEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE
16FALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSEFALSE

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
November 2018

It also dawned on me that, using a shared workbook, my VBA code won't be able to add new conditional formatting, so I will need to rely on similar catch-all formatting for some similar testing of the event viability. All I need is to get this first formatting right first!
 
Upvote 0

Forum statistics

Threads
1,216,111
Messages
6,128,898
Members
449,477
Latest member
panjongshing

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top