Hello everyone,
kindly take a look on the attached file.
I need to find the right certificate depending on fuel level, date and quantity.
Task seems to me very difficult.
CaptureA.JPG
Hello everyone,
kindly take a look on the attached file.
I need to find the right certificate depending on fuel level, date and quantity.
Task seems to me very difficult.
CaptureA.JPG
I have written a macro and slightly altered your sheet (added some stuff) to (I think) get you to part way to where you need to be.
Press the 'Which Cert?' button to recalculate after an IN/OUT is entered.
Let me know if this is getting close. Maybe we can tweak a bit more if you like.
Please Login or Register to view this content.
Just thinking how you might want to use this in the real world, and I think the following minor change may be required. Let me know
The first macro, recalculates the certificates from the beginning each time, given the latest delivery.Please Login or Register to view this content.
The second will not recalculate if a vehicle has been and gone with the fuel and then more fuel comes in.
Last edited by Croweater; 02-15-2022 at 09:56 PM.
I'm soo sorry for a late respone, it's been a while. I appreciate any of your help.
Your code is working but not like i0ve been expected.
It's shows N/A rather than right value of fuel density.
1) Is it possible to enter date like eg. 28/5/22 when hit enter, vaule of that entered cell to be like d/m/y 13:45??
2) In the given file in #1 post, column A is of fuel delivery, and that column is edited manually
=ROUND(SUMPRODUCT(certs;amountoffuel)/SUM(amountoffuel;1) this would give a median for all, in formula range, certificates.
3) It is so inconvenient to me to enter date as d/m/y h:mm. Would be a lot easier to just hit 28/5 and enter, and there in cell to be like 28/5/22 13:45(current time). Not to use =NOW() 'cause it's volatile.
I could use a helper column to look up last couple of delivery rows(in range of a tank capacity, 100.000 litres), and then have a median value of certificates or to have a value of certificate of a greather amount of fuel delivery. Yeah, thats right. I need basic suproduct/sum calculation of last couple of delivery rows or some kind of "running total" to calculate median, then on base of that median, will give me a proximate value of which certificate to give to a customer.
Sorry for my weak english
Last edited by B.W.B.; 05-28-2022 at 04:38 AM. Reason: spelling
The code is dependent on chronological entry of data. That is it won't change a certificate if that certificate has already been calculated.
Delete the "N/A" and press the 'Which Cert' button again. Do you now get the expected result?
To enter the current date hit Ctrl + ; (Hold Control key and type semi colon.
To enter the current time hit Ctrl + Shift + ; (Hold Control key and Shift key and press semi clon)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks