+ Reply to Thread
Results 1 to 12 of 12

sum(hlookup( with cell references instead of values for col_indexes

  1. #1
    Registered User
    Join Date
    09-10-2015
    Location
    London
    MS-Off Ver
    365 at work, 2016 at home
    Posts
    79

    sum(hlookup( with cell references instead of values for col_indexes

    I think I've done all the hard work, and just can't get the last bit of syntax right.

    Please Login or Register  to view this content.
    Works to give the answer I want, currently. However, what I actually need is the values in {} to come from another cell, then the same cell +1...+6, so e.g.
    Please Login or Register  to view this content.
    Where A1 is currently 5, but will change, and that's the point.
    I've tried lots, but no combination of brackets, ' or " will make it work.
    Using " does at least produces a #REF error, suggesting that's closest.
    When typing it out from scratch, clicking on the cell produces the "there's a problem with this formula, not trying to type a formula?" error, suggesting it's not possible.
    Please tell me it's possible?

    I'm guessing the cause of my problem might have something to do with the same reason we have to list each individual target between commas, instead of denoting a range.

    Thanks muchly in advancesample book sumhlookup.xlsx
    Last edited by cheesemeister; 11-18-2020 at 06:19 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: sum(hlookup( with cell references instead of values for col_indexes

    Post a workbook (see yellow banner) showing an example of your layout and also what you expect to find (and why if it's not obvious). The post is confusing.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,250

    Re: sum(hlookup( with cell references instead of values for col_indexes

    Maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Assuming A1=5 and B1=11

    Good luck!
    Last edited by Estevaoba; 11-18-2020 at 12:54 AM.

  4. #4
    Registered User
    Join Date
    09-10-2015
    Location
    London
    MS-Off Ver
    365 at work, 2016 at home
    Posts
    79

    Re: sum(hlookup( with cell references instead of values for col_indexes

    I can't post a workbook, javascript error tried on 2 machines 4 browsers, posting screenshots takes me to the forum's firewall provider sucuri (I know it's not my firewall...) who won't allow javascript apparently.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: sum(hlookup( with cell references instead of values for col_indexes

    How about
    =SUMIFS($C$11:$C$41,$A$11:$A$41,">="&LEFT(A43,2)+0,$A$11:$A$41,"<="&LEFT(A43,2)+6)

  6. #6
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,250

    Re: sum(hlookup( with cell references instead of values for col_indexes

    Did you try the formula in my post #3?

  7. #7
    Registered User
    Join Date
    09-10-2015
    Location
    London
    MS-Off Ver
    365 at work, 2016 at home
    Posts
    79

    Re: sum(hlookup( with cell references instead of values for col_indexes

    Try this
    https://docs.google.com/spreadsheets...it?usp=sharing

    The sum(hlookup with values in the {} doesn't work in google sheets, but reproduce the book in excel and it does work.

    I did try the suggestions posted. don't think they fit what I'm trying to do, hence the focus on getting a sample up.

    I can do this with a series of individual lookups in a hidden col, and a separate sum, but there's a few reasons I want to get it in a single cell if I can.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: sum(hlookup( with cell references instead of values for col_indexes

    The formula I supplied in post#5 works with the file you uploaded in your op.
    Are you actually trying to do this in Sheets or in Excel?

  9. #9
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,250

    Re: sum(hlookup( with cell references instead of values for col_indexes

    I guess the OFFSET and WEEKDAY functionS work in Google sheets, so, assuming dates starting from November 1st in cell A12 and down, try this in any blank cell and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,250

    Re: sum(hlookup( with cell references instead of values for col_indexes

    Another option for the yellow portion in your worksheet, cell C44 copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-10-2015
    Location
    London
    MS-Off Ver
    365 at work, 2016 at home
    Posts
    79

    Re: sum(hlookup( with cell references instead of values for col_indexes

    There was another bit to it that I'd got to work wrapped around a simpler lookup, that wouldn't work around fluff's formula, it just needed a tweak I wasn't seeing though so fluff's solution does work after all. grovel grovel fluff, and thanks muchly both.

    Solved.

    mildly intrigued if it's actually possible to do it the way I originally tried though - can you put cell refs in an array like that, if so, how. I guess that question's never getting an answer.

    Definitely want to figure out why I can't post sample files, that's going to be a major handicap.

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: sum(hlookup( with cell references instead of values for col_indexes

    can you put cell refs in an array like that
    Fraid not.

    Glad to help & thanks for the feedback.

+ 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. Multiple cell references and true values
    By TH8 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2018, 11:04 AM
  2. [SOLVED] Find the cell references for the top 3 values in an array
    By gcooper in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-31-2018, 07:26 AM
  3. HLookup Using Absolute References
    By gmcjhill in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-13-2015, 05:29 PM
  4. File references provided in Cell Values
    By askrocks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2013, 09:56 PM
  5. Copying values/numbers instead of cell references
    By Jpdparadis in forum Excel General
    Replies: 6
    Last Post: 12-20-2010, 09:56 AM
  6. Adding numbers to cell references in formula, rather than cell values
    By stanja in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2009, 07:41 PM
  7. Summing Values Using Indirect Cell References
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-28-2005, 11:02 AM

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