+ Reply to Thread
Results 1 to 9 of 9

Merged cells issue

  1. #1
    Registered User
    Join Date
    09-08-2010
    Location
    Montenegro
    MS-Off Ver
    Excel 2010
    Posts
    82

    Merged cells issue

    Hi. I have received a file which shows strange behaviour of merged cells: the value displayed in merged cells counts twice towards the sum. Please see attached file.

    As far as I know, merged cells work by assigning the value to the top left cell; all other cell in merged range have value zero.

    In my example, cells C10 and C11 are merged, and value in that merged cell is 1,900.

    However, if you go to another cell and type formula =C10+C11, you get 3,800!

    If you type =C10, you get 1,900, and if you type =C11, you get again 1,900! To my understanding, C11 should be zero, shouldn't it?!

    If I unmerge cells, I see these duplicate values in each cell. If I merge them again, they behave as exxpected - I get message that only first cell value would be preserved.

    I'm opening it with Excel 2016, and I'm pretty sure it was created with 2016, too.

    Can someone check what is wrong with this file, please. Thanks in advance.
    Attached Files Attached Files
    Last edited by froment; 04-21-2017 at 02:18 AM. Reason: To mark as solved.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Merged cells issue

    Unmerge the cells

    You have 1900 in BOTH C10 AND C11.
    Hence the 3800.

    Put 0 in C11.
    remerge the cells and the result is now 1900.

    Its the data you've input before merging.


    Also, the giveaway is your first sentence.
    "I have received a file"

    suggesting someone else is respionsible for setting this up.
    They've obviously done it wrong.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Merged cells issue

    @ Special-K

    Do you have any ideas how it was possible to create such merged cells in the first place?
    Dave

  4. #4
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Merged cells issue

    Tim, I'd forgotten about your thread. Finally this reminded me - and I see it now. You said "VBA property Usedrange, is not accurate." what do you mean by that? It strikes me that this has the potential to be very useful for serial mergers... but only if it is accurate.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Merged cells issue

    @ tim201110

    Thanks for sharing. That's quite a find and something to stay alert for.

    Wow! Merged cells are the devil's spawn after all.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Merged cells issue

    Didn't I tell you...

  8. #8
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Merged cells issue

    Quote Originally Posted by Glenn Kennedy View Post
    Tim, I'd forgotten about your thread. Finally this reminded me - and I see it now. You said "VBA property Usedrange, is not accurate." what do you mean by that? It strikes me that this has the potential to be very useful for serial mergers... but only if it is accurate.
    Glenn, here it is.
    in the attached file there is a comparison of different methods for usedrange count.
    PS It has nothing with this ussue , It is about autofill
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-08-2010
    Location
    Montenegro
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Merged cells issue

    Thanks a lot for support, guys, and especially to Tim for solution.

    Weird, I did not know this, nice to learn it; but when I think of it, it makes sense: when you paste only formats, you tell Excel not to touch anything but the formats, so values of all cells remain the same, hence the value in all merged cells...

    Quote Originally Posted by Special-K View Post
    Unmerge the cells

    You have 1900 in BOTH C10 AND C11.
    Hence the 3800.

    Put 0 in C11.
    remerge the cells and the result is now 1900.
    While I appreciate your prompt attempt to help, I have to say it was off the mark - of course, I knew I could unmerge it and merge manually, but I wondered how did the values appear in all merged cells instead in the top left cell of merged region, as it happens when you merge the cells.

+ 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. [SOLVED] Issue with sorting and merged cells
    By kspeese in forum Excel General
    Replies: 2
    Last Post: 07-14-2016, 01:34 AM
  2. Replies: 0
    Last Post: 11-25-2014, 07:08 AM
  3. [SOLVED] very odd question / issue with vba and merged cells
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2014, 12:03 PM
  4. Mutually Exclusive Tick Marks (Merged Cells / ClearContents issue)
    By mjvoce in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2013, 05:26 AM
  5. [SOLVED] sort a column with expanded selection - issue with merged cells.
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2013, 11:33 AM
  6. Replies: 1
    Last Post: 06-28-2012, 11:53 AM
  7. Merged cells sorting issue
    By studio52 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2011, 11:28 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