Can you do an IF(AND array

Goliath1234

New Member
Joined
Nov 7, 2018
Messages
3
Hi,

I am trying to create a calendar from a list of activities where if the cell is between a certain time frame it will output the name of the activity during that time frame. The name of cells are within three cells A5, B5 and C5 which the text will be combined into the one cell. However i currently have this set to one specific row 5 (1 activity). I would like this to pick up an array of rows (multiple activities) but the AND function wont let me do a formula with an array. See below formula.

=IF(AND(K25>$D$5,K25<$F$5),$A$5 &" " & $B$5 & " " &$C$5," ")

i have attempted the below but get a #VALUE ! error
=IF(AND(K25>$D5:$D8,K25<$F5:$F8),$A5:$A8 &" " & $B5:$B8 & " " &$C5:$C8," ")

Is there a way around this?

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi,

Most probably you will need an Array Formula ...

Could you describe your worksheet ... and give an example of your expected result ...
 
Upvote 0
Hi,

Most probably you will need an Array Formula ...

Could you describe your worksheet ... and give an example of your expected result ...


Hi James,

Data from columns A-G are shown in table below;

[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD][TABLE="width: 145"]
<tbody>[TR]
[TD="class: xl65, width: 145"]Activity[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 117"]
<tbody>[TR]
[TD="class: xl65, width: 117"]Supplier[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 174"]
<tbody>[TR]
[TD="class: xl65, width: 174"]Description[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="class: xl65, width: 80"]Time in[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75"]Date In[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="class: xl65, width: 80"]Time Out[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75"]Date out[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 145"]
<tbody>[TR]
[TD]Flight[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 117"]
<tbody>[TR]
[TD]Qatar Airways[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 174"]
<tbody>[TR]
[TD]Sydney to Doha[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="align: right"]21:45:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="align: right"]18/02/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="align: right"]05:20:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="align: right"]19/02/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

The aim in these columns is to produce a calendar style format next to it. Text from A,B,C get put into one box when the time is between the selected times in Column D & F. See below.

[TABLE="width: 226"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD]18 February 2019[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]20:00:00[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]21:00:00[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]22:00:00[/TD]
[TD]Flight Qatar Airways Sydney to Doha[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 226"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: right"]23:00:00[/TD]
[TD]Flight Qatar Airways Sydney to Doha[/TD]
[/TR]
[TR]
[TD="align: right"]00:00:00[/TD]
[TD]Flight Qatar Airways Sydney to Doha[/TD]
[/TR]
</tbody>[/TABLE]

The problem with this is i can't get an array formuyla to work with a selection of columns.
 
Upvote 0
Hi,

In order to make your life easier, my recommendation would be :

1. To use Sheet 1 for all your Data

2. To build your Calendar in Sheet 2

3. To use a macro to automate and speed up your process

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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