SOLVED

Populating cell with value in immediate criteria match

%3CLINGO-SUB%20id%3D%22lingo-sub-2649475%22%20slang%3D%22en-US%22%3EPopulating%20cell%20with%20value%20in%20immediate%20criteria%20match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2649475%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20all%2C%3C%2FP%3E%3CP%3EI%20have%20attached%20a%20spreadsheet%20containing%20raw%20data%20set%20for%20a%20fuel%20control%20spreadsheet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%204%20types%20of%20vehicles%3A%3C%2FP%3E%3CP%3E-%20Trucks%2C%20we%20dispense%20the%20exact%20amount%20of%20fuel%20according%20to%20the%20destination.%20The%20file%20works%20out%20the%20usage%20for%20those%20vehicles%2C%20therefore%20doesn't%20require%20attention%3C%2FP%3E%3CP%3E-%20Earthmoving%2C%20Buses%20%26amp%3B%20Other%20vehicles%2C%20we%20give%20fuel%20by%20completely%20filling%20up%20the%20tank.%20We%20are%20only%20able%20to%20know%20the%20usage%20the%20next%20time%20they%20refill.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20case%20of%20the%20Earthmoving%2C%20Buses%20%26amp%3B%20Other%20vehicles%2C%20I%20would%20like%20to%20automatically%20populate%20column%20M%20(%22Actual%20Volume%20Used%22)%20with%20the%20next%20entry%20for%20the%20same%20vehicle.%20Therefore%20we%20need%20a%20criteria%20match%20in%20column%20E%20(%22Vehicle%20Fleet%20Number%22)%20and%20populate%20the%20cell%20with%20the%20next%20volume%20reading%20(column%20L)%20IF%20cells%20in%20column%20Q%20are%20%22Earthmoving%22%2C%20%22Buses%22%20or%20%22Other%20Vehicles%22.%20If%20there's%20no%20criteria%20match%2C%20we%20can%20keep%20the%20same%20formula%20currently%20present.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20this%20makes%20sense%2C%20any%20help%20would%20be%20hugely%20appreciated.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20Thanks%2C%20Vito%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2649475%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2649493%22%20slang%3D%22en-US%22%3ERe%3A%20Populating%20cell%20with%20value%20in%20immediate%20criteria%20match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2649493%22%20slang%3D%22en-US%22%3EI%20have%20tried%20the%20following%20formula%20in%20column%20M%2C%20but%20it%20doesn't%20seem%20to%20work%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3DIF(OR(Q5%3D%22EARTHMOVING%22%2CQ5%3D%22BUSES%22)%2C(VLOOKUP(E5%2CE6%3AI%249999%2C8%2CFALSE))%2CL5-K5)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2649676%22%20slang%3D%22en-US%22%3ERe%3A%20Populating%20cell%20with%20value%20in%20immediate%20criteria%20match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2649676%22%20slang%3D%22en-US%22%3EThank%20you%20for%20the%20reply.%20I%20have%20expanded%20my%20lookup%20range%20from%20E%3AL.%20It%20appeared%20to%20popular%20the%20cell%20correctly%2C%20but%20if%20I%20change%20the%20volume%20value%20it%20doesn't%20automatically%20change%20the%20value%20in%20column%20M.%20Would%20you%20have%20any%20idea%20why%20this%20happens%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2649687%22%20slang%3D%22en-US%22%3ERe%3A%20Populating%20cell%20with%20value%20in%20immediate%20criteria%20match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2649687%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1114833%22%20target%3D%22_blank%22%3E%40vitoaiaco%3C%2FA%3E%26nbsp%3BSorry%2C%20don't%20follow.%20Cell%20M9%20will%20return%20119.00%20with%20the%20adjusted%20formula.%20This%20is%20the%20number%20found%20in%20L19%20for%20vehivle%20number%20%22LD%2002%22.%20Correct%3F%20What%20volume%20(e.g.%20in%20which%20column%2Fcell)%20doesn't%20change%20the%20value%20in%20M%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2649728%22%20slang%3D%22en-US%22%3ERe%3A%20Populating%20cell%20with%20value%20in%20immediate%20criteria%20match%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2649728%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BYes%2C%20that's%20correct...%20As%20it%20stands%2C%26nbsp%3B%3CSPAN%3ECell%20M9%20will%20CORRECTLY%20return%20119.00%20with%20the%20adjusted%20formula.%20Let's%20say%20you%20change%20the%20value%20in%20L19%20to%20200%20instead%20of%20119.%20The%20value%20in%20M9%20will%20still%20be%20119.00%20UNLESS%20I%20manually%20refresh%20the%20formula%20in%20M9.%20Is%20there%20a%20way%20to%20automatically%20refresh%20the%20formula%20to%20populate%20according%20to%20the%20latest%20entry%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EMany%20Thanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EVito%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Dear all,

I have attached a spreadsheet containing raw data set for a fuel control spreadsheet.

 

We have 4 types of vehicles:

- Trucks, we dispense the exact amount of fuel according to the destination. The file works out the usage for those vehicles, therefore doesn't require attention

- Earthmoving, Buses & Other vehicles, we give fuel by completely filling up the tank. We are only able to know the usage the next time they refill.

 

In the case of the Earthmoving, Buses & Other vehicles, I would like to automatically populate column M ("Actual Volume Used") with the next entry for the same vehicle. Therefore we need a criteria match in column E ("Vehicle Fleet Number") and populate the cell with the next volume reading (column L) IF cells in column Q are "Earthmoving", "Buses" or "Other Vehicles". If there's no criteria match, we can keep the same formula currently present.

 

I hope this makes sense, any help would be hugely appreciated. @mtarler 

Many Thanks, Vito

7 Replies
I have tried the following formula in column M, but it doesn't seem to work:

=IF(OR(Q5="EARTHMOVING",Q5="BUSES"),(VLOOKUP(E5,E6:I$9999,8,FALSE)),L5-K5)
best response confirmed by vitoaiaco (Occasional Contributor)
Solution

@vitoaiaco That formula breaks because you are trying to look up the 8th column in a range that contains only 5 columns (E through I).

Thank you for the reply. I have expanded my lookup range from E:L. It appeared to popular the cell correctly, but if I change the volume value it doesn't automatically change the value in column M. Would you have any idea why this happens?

@vitoaiaco Sorry, don't follow. Cell M9 will return 119.00 with the adjusted formula. This is the number found in L19 for vehivle number "LD 02". Correct? What volume (e.g. in which column/cell) doesn't change the value in M?

@Riny_van_Eekelen Yes, that's correct... As it stands, Cell M9 will CORRECTLY return 119.00 with the adjusted formula. Let's say you change the value in L19 to 200 instead of 119. The value in M9 will still be 119.00 UNLESS I manually refresh the formula in M9. Is there a way to automatically refresh the formula to populate according to the latest entry?

 

Many Thanks

Vito

 

 

 

 

Apologies, I had changed to calculation options to manual and therefore not automatically refreshing the data. It's now working, THANK YOU!

@vitoaiaco Was just writing a response along those lines. You're welcome!