Populate cell based on RANGE of CALCULATED values.

pommesmitmayo

New Member
Joined
Jun 12, 2011
Messages
23
My request is very similar to the question asked here;

But I'd like to add a twist.
So, supposing I'm cook, (I'm not), and I have a range of different serving dishes I can use depending on how much of a certain liquid I'm serving.
Now, in cell A1 I'd have the flow rate of a tap.
Cell B1 would be the length of time that tap is open for.
C1 would contain the product of these two cells and indicate how much water had passed. It could be anywhere between 100ml and 100L.
D1 would be where my output is and would return the name of one of six vessels;
  • Vessel 1, holds between 0 and 500ml.
  • Vessel 2, holds between >500ml and 1L.
  • Vessel 3, holds between >1L and 5L.
  • Vessel 4, holds between >5L and 10L.
  • Vessel 5, holds between >10L and 35L.
  • Vessel 6, holds between >35L and 100L.
For basic calls like this I'd usually look to VLOOKUP, but is this possible in this instance where the calculation might return 17,236ml which is nowhere near the values you'd usually find in a look up table??
You can see that I'd need vessel 5 for this and although Vessel 6 would also I work, I don't want this value returned.

Any pointers would be fab.

Thankyou.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
It sounds like you just need a simple VLOOKUP?

ABC
1
2LitresVessel
301
40.52
513
654
7105
8356
9100Too much!
10
11My Quantity17.236
12Vessel to use5
Sheet1
Cell Formulas
RangeFormula
C12C12=VLOOKUP(C11,B3:C9,2,1)


You might want to play with the boundary limits, e.g. if you had 9.9 litres, say, it would just fit in vessel 4, but you might prefer to put it into vessel 5.
 
Upvote 0
Solution
Oh right, you mean I kind of had the answer all along?
O notice that in your VLOOK up you don't have the True or False values. Why is that?
 
Upvote 0
I've just used 1, instead of TRUE.

TRUE
is the default value for the range_lookup argument if it's not specified, so I could have omitted the argument:

C12=VLOOKUP(C11,B3:C9,2)

But I prefer to put it in, as then I'm totally clear in my mind whether I want an approximate match or an exact match.

There are plenty of posts on this forum from people getting caught out in the other direction. Forgetting to specify FALSE or 0 for an exact match, and then wondering why their VLOOKUP is returning the wrong value.
 
Upvote 0
I've just used 1, instead of TRUE.

TRUE
is the default value for the range_lookup argument if it's not specified, so I could have omitted the argument:

C12=VLOOKUP(C11,B3:C9,2)

But I prefer to put it in, as then I'm totally clear in my mind whether I want an approximate match or an exact match.

There are plenty of posts on this forum from people getting caught out in the other direction. Forgetting to specify FALSE or 0 for an exact match, and then wondering why their VLOOKUP is returning the wrong value.
Oh I see. Well you learn something every day.
VLookup is giving me grief at the moment, but I'll experiment and see what gives. There are formulas in the sheet to arrive at some of the values for the lookup function but for some reason the sheet doesn't calculate properly.
 
Upvote 0
Hi again, the sheet is almost there. It doesn't seem to work exactly though.
Can I send to you for comment pls?

If so, shall I PM or up load here?
 
Upvote 0
You cannot upload a sheet here, either use the XL2BB add-in to post a mini-sheet as Stephen did in post#2 or upload to a share site & mark for sharing & then post the link you are given.
 
Upvote 0
Hi again, the sheet is almost there. It doesn't seem to work exactly though.

Here's your workbook. What should be happening?

test.xlsx
ABCDEFGHIJKL
1CUPS_protect1
2Box size12123
3Cans per box6Type 12.52.54
4Boxes per pallet40Type 262.54
5Cans per pallet240Type 1161625
6Number of pallets3Type 2351625
7Total box count120
8Total can count720
9Required volume40000.00
10Losses99.50%
11Actual volume needed40201.00503
12Volume/can55.83
13Volume/box335.01
14Min ranges1.67
15C17 / C633.43
16C5 * C14400.80
17C11 / C6100.30
18
19Box sizeCans per box
20126
2163
2242
2321
24
25Min set up ranges
261.6
271.65
281.67
291.7
301.75
311.78
321.8
331.83
34
351.50
3630.0024.0019.502.50
3740.0034.0027.004.00
3854.0046.0038.006.00
3972.0061.0051.0010.00
40100.0087.0072.0016.00
41135.00118.0099.0025.00
42179.00158.00133.0035.00
43225.00198.00168.0050.00
44283.00250.00214.0070.00
45354.00314.00271.0095.00
46425.00378.00328.00120.00
47501.00446.00388.00150.00
48578.00515.00449.00185.00
49659.00587.00514.00240.00
50795.00705.00618.00300.00
51923.00813.00713.00400.00
521120.00977.00857.00500.00
531270.001085.00950.00630.00
541460.001213.001139.00630.00
550.50
560.75
571.00
581.50
5924.0019.502.50
6034.0027.004.00
6130.0046.0038.006.00
6239.0061.0051.0010.00
6351.0087.0072.0016.00
6473.00118.0099.0025.00
6597.00158.00133.0035.00
66140.00198.00168.0050.00
67175.00250.00214.0070.00
68216.00314.00271.0095.00
69258.00378.00328.00120.00
70302.00446.00388.00150.00
71347.00515.00449.00185.00
72394.00587.00514.00240.00
73471.00705.00618.00300.00
74541.00813.00713.00400.00
75644.00977.00857.00500.00
76738.001085.00950.00630.00
77861.001213.001139.00630.00
78
CALC
Cell Formulas
RangeFormula
C3C3=VLOOKUP(C2,B19:KC23,2,FALSE)
J3J3=VLOOKUP(C15,B36:E54,4,1)
K3K3=VLOOKUP(C15,C36:E54,3,1)
L3L3=VLOOKUP(C15,D36:E54,2,1)
J4J4=VLOOKUP(C15,B55:E77,4,1)
K4K4=VLOOKUP(C15,C55:E77,3,1)
L4L4=VLOOKUP(C15,D55:E77,2,1)
J5J5=VLOOKUP(C17,B36:E54,4,1)
K5K5=VLOOKUP(C17,C36:E54,3,1)
L5L5=VLOOKUP(C17,D36:E54,2,1)
J6J6=VLOOKUP(C17,B55:E77,4,1)
K6K6=VLOOKUP(C17,C55:E77,3,1)
L6L6=VLOOKUP(C17,D55:E77,2,1)
C5C5=C3*C4
C7C7=C4*C6
C8C8=C5*C6
C11C11=C9/C10
C12C12=C11/C8
C13C13=C11/C7
C15C15=C17/C6
C16C16=C5*C14
C17C17=C11/C16
Cells with Data Validation
CellAllowCriteria
C2List=$B$20:$B$23
C14List=$B$26:$B$33
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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