+ Reply to Thread
Results 1 to 14 of 14

excel formula for fuel inventory sale with mix costs

  1. #1
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    excel formula for fuel inventory sale with mix costs

    kindly , i'm a Local gas station owner looking to battle this formula but no luck so far
    i have the formula to deduct the sales in column C from the delivery in Column D and multiplying by the cost in Column C for the profit purposes .
    the formula i'm looking for is when the inventory of the first delivery gallons is sold completely , i want the formula to move to second delivery volume with the new cost and also takes in consideration that if in the middle of the day we sold remaining fuel from the previous delivery at the previous cost , so i have accurate numbers from both deliveries volume sold with two different cost . i'm not sure is it FIFO process but with mixed costs ! i have attached the sheet and your help is greatly appreciated
    thank you Book2.xlsx

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,298

    Re: excel formula for fuel inventory sale with mix costs

    This proposal assumes that you are still using the 2007 version of Excel and therefore includes some array entered formulas.
    1. Copied transpose columns A and C into rows 6:7
    2. Populated rows 4:5 (cost) using**: =IFERROR(INDEX($E$9:$E$19,SMALL(IF(J$9:J$19>0,ROW($E$9:$E$19)-ROW($E$8)),ROWS(J$4:J4))),"")
    3. Populated rows 2:3 (percentage) using**: =IFERROR(INDEX(J$9:J$19,SMALL(IF(J$9:J$19>0,ROW($E$9:$E$19)-ROW($E$8)),ROWS(J$2:J2)))/J$7,"")
    4. Populated row 1 (average cost) using: =SUMPRODUCT(J2:J3,J4:J5)
    5. Populated rows 9:19 (portion of sale from purchase) using: =MIN(J$7-SUM(J$8:J8),$D9-SUM($I9:I9))
    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Note that any of the rows listed in steps 1:4 above may be hidden for aesthetic purposes.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,900

    Re: excel formula for fuel inventory sale with mix costs

    @Fatekb
    If you are using a later version of excel, please update your profile to reflect that. There may be other solutions available to you if you are using a later version of Excel.

    Also: Please look at the banner at the top of this page on how to attach a sample file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Re: excel formula for fuel inventory sale with mix costs

    Thank you so much, I will try that and keep you posted , also I'm using office 2019 , will this array formula still work ?

  5. #5
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Re: excel formula for fuel inventory sale with mix costs

    Thank you Alan , yes I did update the office version to 2019 and thanks for bringing the attachments issue to my attention

    Fatek

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,298

    Re: excel formula for fuel inventory sale with mix costs

    Yes, but the following will work without array entering:
    For rows 4:5 =IFERROR(INDEX($E$9:$E$19,AGGREGATE(15,6,(ROW($E$9:$E$19)-ROW($E$8))/(J$9:J$19>0),ROWS(J$4:J4))),"")
    For rows 2:3 =IFERROR(INDEX(J$9:J$19,AGGREGATE(15,6,(ROW($E$9:$E$19)-ROW($E$8))/(J$9:J$19>0),ROWS(J$2:J2)))/J$7,"")
    Let us know if you have any questions.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Re: excel formula for fuel inventory sale with mix costs

    Thank you JeteMC
    i've got sooo close to what I need , and thanks to you
    the only issue encountered is when i expanded the sheet with theoretical numbers to see how it looks for the entire month
    the average cost jumped up way more than it suppose to ! what did i do wrong ?
    I have attached the sheet to look into it
    Thank you and your help is greatly appreciated
    Fatek

    book3.xls.xlsx

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,298

    Re: excel formula for fuel inventory sale with mix costs

    Select cell J2 then drag the fill handle down to cell J3 and then, while J2:J3 are still selected drag the fill handle over to cell AN3.
    Notice that the ROWS argument in J3 is now (J$2:J3) which will evaluate to 2 (The Evaluate Formula feature on the Formulas may be helpful in getting a better understanding).
    Similarly select cell J4 then drag the fill handle down to cell J5 and then, while J4:J5 are still selected drag the fill handle over to cell AN5.
    Let us know if you have any questions.

  9. #9
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Re: excel formula for fuel inventory sale with mix costs

    Thanks a lot , that worked

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,298

    Re: excel formula for fuel inventory sale with mix costs

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  11. #11
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Re: excel formula for fuel inventory sale with mix costs

    last and final , i would want to add under row 41 the real $ cost for that day .
    tricky when you have two sale volumes in a column to be multiplied by two different costs (1st cost and 2nd Cost)

    thank you

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,298

    Re: excel formula for fuel inventory sale with mix costs

    I don't understand the difference between real $ cost and Av. Cost as shown in row 1.
    Please tell us the expected value of real $ cost for column N and, unless the calculation is obvious, please include an explanation so that we have a better understanding.
    Let us know if you have any questions.

  13. #13
    Registered User
    Join Date
    12-29-2012
    Location
    USA
    MS-Off Ver
    Office 2019
    Posts
    37

    Re: excel formula for fuel inventory sale with mix costs

    Hello JeteMC
    you are absolutely right , the Real and average cost will be the same in $$
    please disregard my inquiry
    happy thanksgiving

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2504
    Posts
    19,298

    Re: excel formula for fuel inventory sale with mix costs

    A Happy Thanksgiving to you also.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Running Costs of Inventory depending on two dates
    By bryn.jones in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2021, 10:33 AM
  2. Retail inventory, calculating multiple items in a sale
    By Markp2010 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-26-2018, 09:38 PM
  3. [SOLVED] Fuel Comparison Costs
    By John775 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 10-01-2018, 07:16 PM
  4. Replies: 3
    Last Post: 06-18-2015, 02:09 PM
  5. valuation of inventory with their sale value
    By mahaveersomani in forum Excel General
    Replies: 1
    Last Post: 02-19-2013, 04:38 AM
  6. [SOLVED] define exact number of products sale from multiple sale and returned sale orders
    By maabadi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2012, 06:14 AM
  7. Replies: 1
    Last Post: 06-12-2012, 08:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1