JayEmerson
New Member
- Joined
- Jul 9, 2009
- Messages
- 1
I'm trying to save time and generate a script to prepare OFFSET and INDEX formulas and apply with defined Names. My MAIN worksheet has 55 zip codes with references to their columns in Z-DATA worksheet. One column is the monthly median price history; the other is the monthly momentum (EMA) based on the monthly price history.
E.g., in the MAIN worksheet:
------A----------B-------------------C---------------------------------------------------------------
1 -- 90101 -- Z_ZIP_mom -- =OFFSET('Z-Data'!$mmm$2,1,0,COUNT('Z-Data'!$mmm$3:$mmm$2000),1)
2 -- AC -- Z_ZIP_nbr -- =OFFSET('Z-Data'!$nnn$2,1,0,COUNT('Z-Data'!$nnn$3:$nnn$2000),1)
3 -- AA -- Z_ZIP_pt -- =INDEX(Z_ZIP_nbr,COUNTA(Z_ZIP_nbr))
The desired end result is to have 3 defined names added to the Name Manager for each zip code
(e.g.,
Z_90101_mom, =OFFSET('Z-Data'!$AC$2,1,0,COUNT('Z-Data'!$AC$3:$AC$2000),1)
Z_90101_nbr, =OFFSET('Z-Data'!$AA$2,1,0,COUNT('Z-Data'!$AA$3:$AA$2000),1)
Z_90101_pt, '=INDEX(Z_90101_nbr,COUNTA(Z_90101_nbr))
I need to replace five occurrences of ZIP with the contents of A1. I need to replace three occurrences of "mmm" with the contents of A2. I need to replace three occurrences of "nnn" with the contents of A3. Then I need to define the names for each of the 3 in column B. Lastly, I need to proceed down to the next zip code on the MAIN worksheet.
I can't find any help or examples where the contents of a cell (NOT an entire cell) can be copied and pasted in the Replace dialog box AND being able to iterate the process for the next zip code.
E.g., in the MAIN worksheet:
------A----------B-------------------C---------------------------------------------------------------
1 -- 90101 -- Z_ZIP_mom -- =OFFSET('Z-Data'!$mmm$2,1,0,COUNT('Z-Data'!$mmm$3:$mmm$2000),1)
2 -- AC -- Z_ZIP_nbr -- =OFFSET('Z-Data'!$nnn$2,1,0,COUNT('Z-Data'!$nnn$3:$nnn$2000),1)
3 -- AA -- Z_ZIP_pt -- =INDEX(Z_ZIP_nbr,COUNTA(Z_ZIP_nbr))
The desired end result is to have 3 defined names added to the Name Manager for each zip code
(e.g.,
Z_90101_mom, =OFFSET('Z-Data'!$AC$2,1,0,COUNT('Z-Data'!$AC$3:$AC$2000),1)
Z_90101_nbr, =OFFSET('Z-Data'!$AA$2,1,0,COUNT('Z-Data'!$AA$3:$AA$2000),1)
Z_90101_pt, '=INDEX(Z_90101_nbr,COUNTA(Z_90101_nbr))
I need to replace five occurrences of ZIP with the contents of A1. I need to replace three occurrences of "mmm" with the contents of A2. I need to replace three occurrences of "nnn" with the contents of A3. Then I need to define the names for each of the 3 in column B. Lastly, I need to proceed down to the next zip code on the MAIN worksheet.
I can't find any help or examples where the contents of a cell (NOT an entire cell) can be copied and pasted in the Replace dialog box AND being able to iterate the process for the next zip code.
Last edited: