Closed Thread
Results 1 to 8 of 8

Referencing merged cells

  1. #1
    Registered User
    Join Date
    09-09-2006
    Posts
    3

    Referencing merged cells

    Hello,

    I would like to reference the text in a set of merged cells with a function. If I have merged cells A1&A2, and then I reference them with the formulas "=A1" and "=A2", only the "=A1" returns the contents of the merged cells. The "=A2" formula returns 0.

    Is there a way to get the contents of the merged cells regardless of which one is referenced (i.e. from EITHER A1 or A2)?

    Many thanks all,

    Will

  2. #2
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by willblatchley
    Hello,

    I would like to reference the text in a set of merged cells with a function. If I have merged cells A1&A2, and then I reference them with the formulas "=A1" and "=A2", only the "=A1" returns the contents of the merged cells. The "=A2" formula returns 0.

    Is there a way to get the contents of the merged cells regardless of which one is referenced (i.e. from EITHER A1 or A2)?

    Many thanks all,

    Will
    when you merge cells A1&A2 it becomes cell A1 only. likewise if you merge cells B1:B5, the name of merged cell will be B1 only. you can fetch data from merged cells by referencing to only first row and first col of merged cells.
    e.g if you merge cells B1:B5 and this contains a values say "excel forum"
    in anyother cell by putting just =B1 will fetch "excel forum" from merged cells.

    hopefully this would help you understand
    Regards.

  3. #3
    Registered User
    Join Date
    09-09-2006
    Posts
    3
    Thanks for your reply. The problem is that I don't know what is the first cell of the merged cells in my function.

    In other words, I want to get the text in cell R[-1]C, even if that cell is part of a set of merged cells. Is this possible?

    Is there some function that returns the top cell of several merged cells? Or a function that tests to see if a cell is part of merged cells or not?

    Thanks,

    Will

  4. #4
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    what you really want to do and what is your data structure is yet unclear.
    please provide some sample data with cell references, in which it resides.

  5. #5
    Registered User
    Join Date
    09-09-2006
    Posts
    3
    Sorry I've been unclear. Perhaps this will help explain.

    Take the following simple sheet. My data is in column A, and includes some merged cells. I place the formula INDIRECT("RC[-1]",0) in column B, and copy it down the sheet. I get the result as shown in column C, but I would like the result shown in column D!


    Please Login or Register  to view this content.


    I realise WHY this doesn't work (as Excel refers to the merged cells A3:A5 as just A3, and A4 & A5 don't essentially exist any more), but I would like to know if there's a way to get around it, and achieve the result in column D. Any help would be very much appreciated!

    Thanks for looking,

    Will

  6. #6
    Registered User
    Join Date
    10-19-2017
    Location
    Charlotte NC
    MS-Off Ver
    365
    Posts
    1

    Re: Referencing merged cells

    Star guy
    This is the easy fix thanks for your information it helped me immensely
    Last edited by gsmccoy; 10-19-2017 at 01:32 PM. Reason: add name

  7. #7
    Registered User
    Join Date
    02-01-2021
    Location
    Ahmedabad
    MS-Off Ver
    2013
    Posts
    4

    Exclamation Re: Referencing merged cells

    dear Sir,

    please clear solutions as i am already facing this issue...

    Paras

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Referencing merged cells

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed 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