Help with a formula if this is possible

AlanSt

New Member
Joined
Jul 8, 2015
Messages
7
Hi

I have a worksheet that I am using to plan deliveries and I would like to know if there is any way that excel can take data from cells in a table and use this to block out cells on an 'overview' grid..

my worksheet is set out as follows, an overview grid at the top of the worksheet set out as below,

cell range A2:A11 have vehicle references i.e a,b,c,d,e etc

across the 1st row starting in cell b1 I have time references , 730,0800,0830,0900 etc


at the bottom of this overview grid I record the order details,each order has a reference, o1,o2,o3 etc
each order can have multiple deliveries, so it could be a delivery at 8am, 10am,and 2pm.
these deliveries are planned on an order line using the same vehicle references and the same time set up 0730,0800,0830 etc

My question is, Can excel use the times of the deliveries and the vehicle references from the order lines to then fill in the respective cells on the overview grid with the order reference, o1,o2 etc

these deliveries can come in, in any order, o1 might be an order for vehicle A, but so might order o4.

The top table is the overview grid, the bottom table represents the order detail

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]0730
[/TD]
[TD="align: center"]0800
[/TD]
[TD="align: center"]0830
[/TD]
[TD="align: center"]0900
[/TD]
[TD="align: center"]0930
[/TD]
[TD="align: center"]1000
[/TD]
[TD="align: center"]1030
[/TD]
[TD="align: center"]1100
[/TD]
[TD="align: center"]1130
[/TD]
[/TR]
[TR]
[TD="align: center"]A
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]o1
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]o1
[/TD]
[TD="align: center"]o2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]o2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]o2
[/TD]
[/TR]
[TR]
[TD="align: center"]B
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]o2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]o1
[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]ref
[/TD]
[TD="align: center"]veh
[/TD]
[TD="align: center"]0730
[/TD]
[TD="align: center"]0800
[/TD]
[TD="align: center"]0830
[/TD]
[TD="align: center"]0900
[/TD]
[TD="align: center"]0930
[/TD]
[TD="align: center"]1000
[/TD]
[TD="align: center"]1030
[/TD]
[TD="align: center"]1100
[/TD]
[TD="align: center"]1130
[/TD]
[/TR]
[TR]
[TD="align: center"]o1
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]x
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]x
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]x
[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]o2
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]x
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]x
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]x
[/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"][/TD]
[TD="align: center"]x
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]

apologies if this sounds confusing,I hope it does make sense.Any help would be much appreciated.

regards
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Are you trying to drive this by VBA or formula?

Simple formula would be
Code:
=IF(C2="X",$A$2,IF(C4="X",$A$4,""))

this assume that your Order detail starts in A1 of the sheet.

In the above code "C2" represents the reference below 0730 and to the right of A in your order sheet. and "C4" represents the range below 0730 and to the right of B.

This formula would be placed below 0730 and to the right of "A" in your overview and could be pulled to the necessary range.

If it was needed to be expanded further you could continue the nested if as far as needed.
 
Last edited:
Upvote 0
[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][td]
G​
[/td][td]
H​
[/td][td]
I​
[/td][td]
J​
[/td][td]
K​
[/td][/tr][tr][td]
1​
[/td][td]
ref
[/td][td]
veh
[/td][td]
0730
[/td][td]
0800
[/td][td]
0830
[/td][td]
0900
[/td][td]
0930
[/td][td]
1000
[/td][td]
1030
[/td][td]
1100
[/td][td]
1130
[/td][/tr]
[tr][td]
2​
[/td][td]
o1
[/td][td]
A
[/td][td]
[/td][td]
x
[/td][td]
[/td][td]
x
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]
[tr][td]
3​
[/td][td="bgcolor:#D9E1F2"]
o1
[/td][td]
B
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
x
[/td][td]
[/td][/tr]
[tr][td]
4​
[/td][td]
o2
[/td][td]
A
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
x
[/td][td]
[/td][td]
x
[/td][td]
[/td][td]
x
[/td][/tr]
[tr][td]
5​
[/td][td="bgcolor:#D9E1F2"]
o2
[/td][td]
B
[/td][td]
[/td][td]
x
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][/tr]
[tr][td]
6​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
7​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
8​
[/td][td][/td][td]
0730
[/td][td]
0800
[/td][td]
0830
[/td][td]
0900
[/td][td]
0930
[/td][td]
1000
[/td][td]
1030
[/td][td]
1100
[/td][td]
1130
[/td][td][/td][/tr]
[tr][td]
9​
[/td][td]
A
[/td][td]
[/td][td]
o1
[/td][td]
[/td][td]
o1
[/td][td]
o2
[/td][td]
[/td][td]
o2
[/td][td]
[/td][td]
o2
[/td][td][/td][/tr]
[tr][td]
10​
[/td][td]
B
[/td][td]
[/td][td]
o2
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
[/td][td]
o1
[/td][td]
[/td][td][/td][/tr]
[/table]


Note the modification to A2:A5, the range of order refs.

In B9 control+shift+enter, not just enter, copy across, and down:

=IFERROR(INDEX($A$2:$A$5,MATCH(1,IF($B$2:$B$5=$A9,IF(C$2:C$5="X",1)),0)),"")
 
Upvote 0
Brilliant, I had never given a VBA much thought, but these formulas make the worksheet behave just the way I had hoped, Thank you so much for your help.

regards
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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