Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Query content of merged cells

Hi,

I have cells B1:E1 merged, and F1:K1 merged and so on.
In the rest of my sheet I have formulas that have to refer to the content of
first row.
If the formula refers to B1, it runs, but if it refers to C1 or D1, it
doesn't run.

In the past, I had all merged range with the same number of cells, then,
instead of C1, I putted
OFFSET($A$1,1,INT((COLUMN(B1)-2)/4)*4+1)
but it isn't always true.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default Query content of merged cells

Use Row 2 instead of Row 1 to compute your offsets

from
OFFSET($A$1,1,INT((COLUMN(B1)-2)/4)*4+1)

to
OFFSET($A$2,0,INT((COLUMN(B2)-2)/4)*4+1)


"Lucio Menci" wrote:

Hi,

I have cells B1:E1 merged, and F1:K1 merged and so on.
In the rest of my sheet I have formulas that have to refer to the content of
first row.
If the formula refers to B1, it runs, but if it refers to C1 or D1, it
doesn't run.

In the past, I had all merged range with the same number of cells, then,
instead of C1, I putted
OFFSET($A$1,1,INT((COLUMN(B1)-2)/4)*4+1)
but it isn't always true.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Query content of merged cells

It's easier than it could appair...
Thank you

"Joel" wrote:

Use Row 2 instead of Row 1 to compute your offsets

from
OFFSET($A$1,1,INT((COLUMN(B1)-2)/4)*4+1)

to
OFFSET($A$2,0,INT((COLUMN(B2)-2)/4)*4+1)


"Lucio Menci" wrote:

Hi,

I have cells B1:E1 merged, and F1:K1 merged and so on.
In the rest of my sheet I have formulas that have to refer to the content of
first row.
If the formula refers to B1, it runs, but if it refers to C1 or D1, it
doesn't run.

In the past, I had all merged range with the same number of cells, then,
instead of C1, I putted
OFFSET($A$1,1,INT((COLUMN(B1)-2)/4)*4+1)
but it isn't always true.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default Query content of merged cells

Hello Lucio,

If you want your type of formula I suggest to take
=OFFSET($A$1,0,INT((COLUMN(B$1)-2)/4)*4+1)

But if you want to have a non-volatile function (that is: a function
which does not recalculate each and every time you press F9):
=INDEX($1:$1,0,FLOOR((COLUMN(B$1)-2),4)+2)

OFFSET is volatile, INDEX is not. BTW: FLOOR does exactly what you
introduce with INT(x/4)^4.

Regards,
Bernd
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofit Merged cell Code is changing the format of my merged cells JB Excel Discussion (Misc queries) 0 August 20th 07 02:12 PM
How to maintain merged cell format when cutting the content away ifjoe Excel Worksheet Functions 2 January 1st 07 01:04 PM
how do i link merged cells to a merged cell in another worksheet. ibbm Excel Worksheet Functions 3 April 27th 06 11:40 PM
excel cell content cuts off when merged to word Salt Lake City Excel Discussion (Misc queries) 1 March 29th 06 07:51 PM
Sorting merged cellsHow do I sort merged cells not identically siz Laval Excel Worksheet Functions 1 November 3rd 04 09:40 PM


All times are GMT +1. The time now is 09:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"