+ Reply to Thread
Results 1 to 9 of 9

Order formula with variable random fields

  1. #1
    Registered User
    Join Date
    07-05-2013
    Location
    Docker River
    MS-Off Ver
    Excel 2010
    Posts
    6

    Order formula with variable random fields

    Hi I want to try and "total" the purchase price of an order form based on the following example. Each week there will be a different number in the "Your Order" column but the price per item is a constant.
    Also I may NOT order every product - every week so only a few of the boxes in "Your Order" may have a value in there.

    Any help much appreciated

    order6.png

    TOTAL PURCHAE PRICE $17.95

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Order formula with variable random fields

    Welcome to the Forum.

    Is there some reason why a simple SUM(G2:G14) won't do?
    Excel only sums cells that have numbers, so if a cell in the Your Order columns is empty to counts as zero.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Order formula with variable random fields

    I *think* you need to use the SUMPRODUCT function.
    This regular formula returns the sum of order qty x Unit Price:
    =SUMPRODUCT(price_range,your_order_range)

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    07-05-2013
    Location
    Docker River
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Order formula with variable random fields

    @Palmetto,

    Thank you for taking the time to reply, The sum function does not do the job for me as it only "sums" the items in the column I need it to pull the cost price from the adjacent column (multiply) and ONLY when there is a value in the "Your Order" column.

    Again thank you for taking the time to help.

    Warm Regards

    Mal
    Last edited by jeffreybrown; 07-05-2013 at 09:59 PM. Reason: As per Forum Rule #12, please don't quote whole post unless necessary -- it's just clutter.

  5. #5
    Registered User
    Join Date
    07-05-2013
    Location
    Docker River
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Order formula with variable random fields

    Hi Ron,

    Thank you for your reply, I was not aware of the "=Sumproduct" function and will certainly try that and let you know if it worked.

    Thank you for taking your time to reply

    Regards

    Mal
    Last edited by jeffreybrown; 07-05-2013 at 10:00 PM. Reason: As per Forum Rule #12, please don't quote whole post unless necessary -- it's just clutter.

  6. #6
    Registered User
    Join Date
    07-05-2013
    Location
    Docker River
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Order formula with variable random fields

    Hi again Ron,

    I tried the "=sumproduct" function with this =SUMPRODUCT(F14*G14:G15:G16:G17 It works on G14 and G15 but after that if I keep typing G:16 etc.. I throws an error. It is also tedious typing each line eg.. G17, G18, G19 and so on... The resulting total is 200 lines down the page - do I need to type each of the 200 lines in the formula?

    Regards
    Last edited by jeffreybrown; 07-05-2013 at 10:00 PM. Reason: As per Forum Rule #12, please don't quote whole post unless necessary -- it's just clutter.

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Order formula with variable random fields

    You may need to attach a workbook...Pictures are rarely adequate for us to get enough information from.

    Here's an example of how SUMPRODUCT can work:
    With
    A1:A5 containing prices
    10
    20
    30
    40
    50

    and
    B1:B5 containing quantities
    0
    1
    0
    10
    0

    This formula calculates the extended total
    =SUMPRODUCT(A1:A5,B1:B5)

    In the above example, that formula returns: 420
    which is the sum of...
    Please Login or Register  to view this content.
    I hope that helps.

  8. #8
    Registered User
    Join Date
    07-05-2013
    Location
    Docker River
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Order formula with variable random fields

    Quote Originally Posted by Ron Coderre View Post
    You may need to attach a workbook...Pictures are rarely adequate for us to get enough information from.

    Here's an example of how SUMPRODUCT can work:
    With
    A1:A5 containing prices
    10
    20
    30
    40
    50

    and
    B1:B5 containing quantities
    0
    1
    0
    10
    0

    This formula calculates the extended total
    =SUMPRODUCT(A1:A5,B1:B5)

    In the above example, that formula returns: 420
    which is the sum of...
    Please Login or Register  to view this content.
    I hope that helps.
    Hi Ron that worked perfectly thank you so much for your help.

    Not sure how to set the thread as resolved and award you the accolades you have earned - yet! but I will read the rules and do same.

    Thank you once again

    Regards

    Mal

  9. #9
    Registered User
    Join Date
    07-05-2013
    Location
    Docker River
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Order formula with variable random fields

    Thank You to both contributors

    **RESOLVED**

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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