+ Reply to Thread
Results 1 to 10 of 10

Thread: Sum cell offset by division by criteria

  1. #1
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    133

    Sum cell offset by division by criteria

    Hi,

    Not sure if Title reflects my question

    I have for example a column with values say A1:A10 and also another column say C1:C10 with some values. What I want to work out is sum the result of
    values from these.

    Column A Column C
    1.57 120
    2.45
    1.45 245
    1.50
    1.57
    Sum result here xxxx
    What to sum - 1.57/120 and 1.45/245

    There maybe 20 rows of data and column c will not have data for each row.

    Does this makes sense ?

    Thanks
    Lionel
    Last edited by Foreverlearning; 02-08-2012 at 01:30 AM.

  2. #2
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,303

    Re: Sum cell offset by division by criteria

    Hi

    Maybe somrthing like this??

    In C1>>>>=IF(B2>0,A2/B2,0)

    Copy down.

    Then use >>>=SUM(C1:C20

    Hope to helps you.
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  3. #3
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    133

    Re: Sum cell offset by division by criteria

    Hi Fotis,

    Actually the C column must be for entering values not formulas

    The only place for formulas can only be in the sum result area

    Thanks
    Lionel

  4. #4
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,303

    Re: Sum cell offset by division by criteria

    Lionel

    The idea is, a helper(hide if you like) Column....

    Take a look to the example.
    Attached Files Attached Files
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  5. #5
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    133

    Re: Sum cell offset by division by criteria

    Hi Fotis,

    I appreciate the help but the number of columns are 20 plus and dynamic and makes it more difficult
    I would think that there must be a formula to solve this.

    Column A is static but the other columns reference the static column A

    Lionel

  6. #6
    Registered User
    Join Date
    05-13-2010
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2007
    Posts
    31

    Re: Sum cell offset by division by criteria

    HI
    may be the formula will work for you

    =SUM(IF(NOT(ISBLANK(B1:B5)),A1:A5/B1:B5))

    I have attached the file used earlier by Fotis1991

    and the cell with the formula is highlighted in yellow. You will have to Array Enter the formula by hitting Ctrl + Shift + Enter.

    PLease let me know if that solves your query!
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Sum cell offset by division by criteria

    Since you are on Excel 2007, this should work

    =SUM(IFERROR(A1:A10/C1:C10,0))

    with CTRL+SHIFT+ENTER, rather than just ENTER
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  8. #8
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    133

    Question Re: Sum cell offset by division by criteria

    Hi Chandrajit & Haseeb A,

    Thank you both for your solutions, both work well.

    A question before closing this thread

    Will Array formulas dramatically slow down the spreadsheet if use frequently over say 20 week-sheets in same work book
    and over say 30 rows and columns per sheet

    Thanks
    Lionel

  9. #9
    Registered User
    Join Date
    05-13-2010
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2007
    Posts
    31

    Re: Sum cell offset by division by criteria

    Dear Friend,
    I do not think that it will cause more slowdown compared to similar usage with non-array formulae. Still better - compact formulae will tremendously reduce the load on worksheets.
    As you can see Haseeb A's solution is more compact and will involve much lesser calculations by Excel than in my solution.
    You may please mark the thread as solved if your query is solved.
    ----------------------
    PS. Good one Haseeb

  10. #10
    Forum Contributor
    Join Date
    06-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007; Excel 2010
    Posts
    133

    Re: Sum cell offset by division by criteria

    Hi Chandrajit,

    Thank you for your reply

    Lionel

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0