ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Concatenate different ranges (https://www.excelbanter.com/excel-programming/286349-concatenate-different-ranges.html)

oxymoron

Concatenate different ranges
 
Hi all,

I have data for every hour in 2001 in one sheet and data for every da
in another sheet.
Now I would like to apply 1/24 of the daily data from the second shee
to each of the 24 hour periods in the first sheet - how can I do this
(automatically!)

VBA is new to me, and I would like to know if I - either directly i
Excel or in VBA - can do arithmic within the cell address itself. Can
in any way do something like this: write A(1+B2) in C3 and make i
work? If B2=3 and A4=2 then C3 shuold end up beeing 2 ...
What if I use the R1C1 approach?

Any help appreciate

--
Message posted from http://www.ExcelForum.com


Tim Barlow

Concatenate different ranges
 
Oxy,

Try entering the following in cell C3:

=INDIRECT("A"& TEXT(1+B2,0))

HTH

Tim


"oxymoron" wrote in message
...
VBA is new to me, and I would like to know if I - either directly in
Excel or in VBA - can do arithmic within the cell address itself. Can I
in any way do something like this: write A(1+B2) in C3 and make it
work? If B2=3 and A4=2 then C3 shuold end up beeing 2 ...
What if I use the R1C1 approach?

Any help appreciated

Message posted from http://www.ExcelForum.com/




J.E. McGimpsey

Concatenate different ranges
 
Another way:

=OFFSET(A1,B2,0)

In article ,
"Tim Barlow" wrote:

Oxy,

Try entering the following in cell C3:

=INDIRECT("A"& TEXT(1+B2,0))

HTH

Tim


"oxymoron" wrote in message
...
VBA is new to me, and I would like to know if I - either directly in
Excel or in VBA - can do arithmic within the cell address itself. Can I
in any way do something like this: write A(1+B2) in C3 and make it
work? If B2=3 and A4=2 then C3 shuold end up beeing 2 ...
What if I use the R1C1 approach?

Any help appreciated

Message posted from http://www.ExcelForum.com/




oxymoron[_2_]

Concatenate different ranges
 
THX both of you - this solved my problems!

The INDIRECT approach isn't described in the Excel Help-file but I like
it ...

OFFSET is great too - can't believe I missed this feature for so long
;-)


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 11:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com