+ Reply to Thread
Results 1 to 9 of 9

Setting up a dynamically generated range reference

Hybrid View

cveetan Setting up a dynamically... 02-21-2012, 04:16 PM
Pete_UK Re: Setting up a dynamically... 02-21-2012, 04:45 PM
JBeaucaire Re: Setting up a dynamically... 02-21-2012, 04:47 PM
martindwilson Re: Setting up a dynamically... 02-21-2012, 04:48 PM
cveetan Re: Setting up a dynamically... 02-21-2012, 05:51 PM
Pete_UK Re: Setting up a dynamically... 02-22-2012, 06:11 AM
cveetan Re: Setting up a dynamically... 02-22-2012, 07:31 AM
Pete_UK Re: Setting up a dynamically... 02-22-2012, 07:37 AM
martindwilson Re: Setting up a dynamically... 02-21-2012, 06:50 PM
  1. #1
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Setting up a dynamically generated range reference

    Quote Originally Posted by cveetan View Post
    ...
    So imagine it like this

    Row6: SUMIF($AG$5:$AM$5,"ITF",INDIRECT(CONCATENATE("AG","6:","AM","6")))

    "AG" replaced by IF(33,CHAR(ROUNDDOWN((33-1)/26,0)+64)&CHAR(MOD((33-1),26)+65),CHAR(33+64))
    "AM" replaced by IF(COLUMN(),CHAR(ROUNDDOWN((COLUMN()-1)/26,0)+64)&CHAR(MOD((COLUMN()-1),26)+65),CHAR(COLUMN()+64))
    ...
    I've tried these as they are in various cells in a blank sheet. The first returns AG wherever it is placed, as "IF(33" is the same as saying "IF(TRUE" so it will always return AG - in that case why not replace it with "AG" ?

    The second expression is incomplete - I think it should be:

    =IF(COLUMN()>26,CHAR(ROUNDDOWN((COLUMN()-1)/26,0)+64)&CHAR(MOD((COLUMN()-1),26)+65),CHAR(COLUMN()+64))

    and this will return the column identifier for whichever column it is in (you might have considered the ADDRESS function).

    @Pete, I've tried your way also but couldn't make it work it gives #REF! error when calculating though CTRL + SHIFT + ENTER
    I'm not really sure why you would need CSE for this, but I think your amended formula should be (taking into account what I've said above):

    =SUMIF($AG$5:$AM$5,"ITF",INDIRECT("AG"&ROW(A6)&":"&IF(COLUMN()>26,CHAR(ROUNDDOWN((COLUMN()-1)/26,0)+64)&CHAR(MOD((COLUMN()-1),26)+65),CHAR(COLUMN()+64))&ROW(A6)))

    You had your quotes in the wrong place.

    Hope this helps.

    Pete

  2. #2
    Registered User
    Join Date
    02-21-2012
    Location
    Varna, Bulgaria
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Setting up a dynamically generated range reference

    Thanks Pete!


    All fixed now! I moved the quotes as you suggested and it worked like a charm.

    You are totally right about the static 33 formula, I've used it just as an example, cause I plan to place a more complex one in its place which shall not be a problem now that I have the placement of the second one resolved. ; )

    Thanks again for your assistance! Cheers pal!

    Cvetan

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Setting up a dynamically generated range reference

    Glad to be of help. Perhaps you can mark the thread as Solved, and if there is any post that has particularly helped you then you can pass on thanks directly by clicking the "star" icon in the bottom left corner.

    Pete

+ 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.6.0 RC 1