+ Reply to Thread
Results 1 to 9 of 9

SUM of Range with formulas

  1. #1
    Registered User
    Join Date
    05-04-2006
    Posts
    39

    SUM of Range with formulas

    In Column B I have a VLOOKUP to Reference Col A to automatically populate Col B if Col A is a repeat entry (B is always tied to A so if A shows up again B is always the same as the previous entry)

    My problem is when I try to sum the range in B it doesn't work I believe because of the formula


    I looked to SUMIF and tried ISNUMER but that doesn't seem to be the right option as I believe it needs to reference another range.


    Houston.....500
    Phoenix......100
    Santa Fe....300
    Houston......=VLOOKUP(A4,$A$1:$B$4,2)

    =SUM(B1:B4) and I would hope to get 1400 but I am getting --

    How can I sum a range with Formulas in it? Thanks

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: SUM of Range with formulas

    I'm not sure where your vlookup table is so I made up my own. Perhaps the setup will help you solve your problem.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Registered User
    Join Date
    05-04-2006
    Posts
    39

    Re: SUM of Range with formulas

    Initial thought, I am using VLOOKUP incorrectly. Thanks I will repost with my fouled logic.

  4. #4
    Registered User
    Join Date
    05-04-2006
    Posts
    39

    Re: SUM of Range with formulas

    I don't think it is worth trying to post my fouled logic.

    Basically I already had lots of entries in my A and B column when I got the idea to try and make B auto populate. So, I put the VLOOKUP in the middle of my Column B to reference the entries I have already entered above it.

    So in B50 for example, my VLOOKUP was essentially =VLOOKUP(A50,A1:B100,2) so the VLOOKUP was checking itself. I will refine my logic and see if I can work through this. My thinking was for the new entries I would just write over the VLOOKUP and input the new entry.

    I then tried making my formula only look at the row above it. So in B50 I then tried =VLOOKUP(A50,A1:B49,2) but that really started giving me some really odd responses. I should note that this file is a Google Spreadsheet.

    I am trying to avoid having to created the VLOOKUP table manually. Trying to have it be dynamic I guess.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: SUM of Range with formulas

    Maybe this...
    =VLOOKUP(A50,$A$1:$B$49,2)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    05-04-2006
    Posts
    39

    Re: SUM of Range with formulas

    Awesome, thank you I got it figured out.

    Using your IF statement at the beginning of my VLOOKUP returns a 0 so SUM works now. Thank you very much!

    Lookup - ndm.xlsx

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: SUM of Range with formulas

    Glad it worked for you

  8. #8
    Registered User
    Join Date
    05-04-2006
    Posts
    39

    Re: SUM of Range with formulas

    Quote Originally Posted by FDibbins View Post
    Maybe this...
    =VLOOKUP(A50,$A$1:$B$49,2)
    Thats pretty close to what I ended up with

    =VLOOKUP(A50,$A$1:$B49,2) is what I ended up with so as I move down the range will continue to grow to check up until the line above it

    My real problem was the SUM, and changing that to =IF(A50="","",VLOOKUP(A50,$A$1:$B49,2,)) helped as it returns a 0 until it has a valid entry which is just what I was needing.

    Thanks!

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: SUM of Range with formulas

    Thanks for the feedback. Glad that you got it figured out.

+ 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. Insert cells, fill formulas down, set formulas for dynamic range
    By Snickers65 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 01:43 PM
  2. Formulas across a range of cells
    By JakeMann in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-07-2013, 11:07 AM
  3. [SOLVED] How to copy a range (including any formulas in the range) into an array?
    By jimmalk in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-28-2012, 01:51 AM
  4. code to add formulas to a range with previous formulas appearing inside the new one
    By Excel-o-ratoR in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2010, 06:02 AM
  5. dynamic range of formulas
    By dreamz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2006, 03:53 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