Bring info in every 6th from another workbook

ozbeachbum

Board Regular
Joined
Jun 3, 2015
Messages
161
Office Version
  1. 2021
Platform
  1. Windows
Hi All,
I am endeavouring to bring in the value from the cell in every 6th row in another workbook, I have tried the formula below without any success.

=OFFSET('[02 REG CHR securities.xlsx]Securities Info'!$BX$75,(ROW('[02 REG CHR securities.xlsx]Securities Info'!BX1)-1)*6,0)

Any assistance would be greatly appreciated.
Cheers,
Dave.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Firstly to Fluff & All, apologies, I have been told I broke the rules when I did the new thread.
I thought by marking this thread solved that it would be closed and now that my query related to a different issue it would require a new thread.

I would like to thank Flashbond for their reply on the other thread;
=INDEX('[02 REG CHR securities.xlsx]Securities Info'!$BX$75:$BX$135,((ROWS($A$1:$A1)-1)*6)+1)
The formula however returns a Zero when the result should 535.
Not sure if this will help, I performed an evaluate formula which showed; 1-1=0 *6=0 +1=1 $BX$75:$BX$135=0

Below is the situation.
I started with;
=OFFSET('[02 REG CHR securities.xlsx]Securities Info'!$BX$75,(ROW('[02 REG CHR securities.xlsx]Securities Info'!BX1)-1)*6,0)

which worked, but requires the linked workbook '[02 REG CHR securities.xlsx] to be open, to recalculate.
I did some research and apparently this is the case when using OFFSET, therefore to solve the recalculating Issue I tried INDEX as suggested in the article;

=INDEX('[02 REG CHR securities.xlsx]Securities Info'!$BX$75,(ROW('[02 REG CHR securities.xlsx]Securities Info'!BX1)-1)*6,0)

I though this solved the issue as it worked, but only in the first cell, when I copied it down, I got an invalid reference or error.
I am sure Flashbond is correct when they say INDEX requires a range.
Any more ideas would be greatly appreciated.
Dave.
 
Upvote 0
1-1=0 *6=0 +1=1 which means first index.
First index of BX75:BX135 must be BX75.
Then 2-1=1 *6=6 +1=7. 7th index must be BX81.. And so on...
I don't know what doesn't work for you :(
 
Upvote 0
Both formulae work for me
Fluff.xlsm
BCDE
75111
76277
7731313
7841919
7952525
8063131
8173737
8284343
8394949
8410
8511
8612
8713
8814
8915
9016
9117
9218
9319
9420
9521
9622
9723
9824
9925
10026
10127
10228
10329
10430
10531
10632
10733
10834
10935
11036
11137
11238
11339
11440
11541
11642
11743
11844
11945
12046
12147
12248
12349
Main
Cell Formulas
RangeFormula
D75:D83D75=OFFSET($B$75,(ROW(B1)-1)*6,0)
E75:E83E75=INDEX(B$75:$B$135,((ROWS($A$1:$A1)-1)*6)+1)
 
Upvote 0
Oh.. @Fluff is right as always. Just ROW would be enough.

Excel Formula:
=INDEX(B$75:$B$135,((ROW($A1)-1)*6)+1)
 
Upvote 0
This would be much easier in Power Query. Bring the data into PQ, add an Index Column from 1, then add a second column that takes the MOD 6 of the Index Column, filter the Custom Column selecting rows that equal 0, then load that into a table.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="GDP"]}[Content],
    ChangedType = Table.TransformColumnTypes(Source,{{"Column1", type date}, {"Column2", type number}}),
    AddedIndex = Table.AddIndexColumn(ChangedType, "Index", 1, 1, Int64.Type),
    InsertedModulo = Table.AddColumn(AddedIndex, "Modulo", each Number.Mod([Index], 6), type number),
    FilteredRows = Table.SelectRows(InsertedModulo, each ([Modulo] = 0)),
    RenamedColumns = Table.RenameColumns(FilteredRows,{{"Column1", "Date"}, {"Column2", "Value"}}),
    RemovedOtherColumns = Table.SelectColumns(RenamedColumns,{"Date", "Value"})
in
    RemovedOtherColumns

This is some of the original data with every 6th row highlighted:
Book1
EF
3Row Count: 303
4Row Count / 6: 50
5
6DateValue
701/01/19472,034.450
804/01/19472,029.024
907/01/19472,024.834
1010/01/19472,056.508
1101/01/19482,087.442
1204/01/19482,121.899
1307/01/19482,134.056
1410/01/19482,136.440
1501/01/19492,107.001
1604/01/19492,099.814
1707/01/19492,121.493
1810/01/19492,103.688
1901/01/19502,186.365
2004/01/19502,253.045
2107/01/19502,340.112
2210/01/19502,384.920
2301/01/19512,417.311
2404/01/19512,459.196
Sheet1
Cell Formulas
RangeFormula
E3E3="Row Count: "
F3F3=COUNT(E7:E309)
E4E4="Row Count / 6: "
F4F4=INT(COUNT(E7:E309)/6)
E6:F6E6=PROPER(A7:B7)
E7:F309E7=_FredRange(A8)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
GDP=Sheet1!$E$7#F3:F4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E7:F309Expression=$G7=0textNO


This is the result of the Power Query transformation:
Book1
IJ
4Row Count: 50
5
6DateValue
704/01/19482121.899
810/01/19492103.688
904/01/19512459.196
1010/01/19522650.431
1104/01/19542654.456
1210/01/19552916.985
1304/01/19572987.699
1410/01/19583065.141
1504/01/19603260.177
1610/01/19613440.924
1704/01/19633669.02
1810/01/19643968.878
1904/01/19664424.581
2010/01/19674618.812
2104/01/19694938.728
2210/01/19704938.857
2304/01/19725368.485
2410/01/19735731.632
2504/01/19755591.382
Sheet1
Cell Formulas
RangeFormula
J4J4=COUNT(GDP_2[Date])


Ignore _FredRange - it's a LAMBDA function. GDP is the named range of the raw data.

Hope that helps.
 
Upvote 0
There is also a single cell spilled array answer:
Book1
G
756
7612
7718
7824
7930
8036
8142
8248
Sheet2
Cell Formulas
RangeFormula
G75:G82G75=LET( Rng, B75:B123, Rslt, IFERROR(IF(MOD(Rng,6)=0, Rng, ""), ""), FILTER(Rslt, ISNUMBER(Rslt)) )
Dynamic array formulas.


The variable Rng is the column of numbers from above, Rslt is the array from the IFERROR section, and the final display is from FILTER.
 
Upvote 0
Another option for a spilled range is simply
Fluff.xlsm
ABCD
7511
7627
77313
78419
79525
80631
81737
82843
83949
8410
8511
8612
8713
8814
8915
9016
9117
9218
9319
9420
9521
9622
9723
9824
9925
10026
10127
10228
10329
10430
10531
10632
10733
10834
10935
11036
11137
11238
11339
11440
11541
11642
11743
11844
11945
12046
12147
12248
12349
Main
Cell Formulas
RangeFormula
D75:D83D75=INDEX(B$75:$B$135,SEQUENCE(9,,,6))
Dynamic array formulas.
 
Upvote 0
Solution
Hi All,
My original INDEX formula that Fluff & Flashbond said should work, now works.
I rebooted and redid them and they work, don't know what is going, but it is not the only issue I have had since upgrading to W11 & Office 20-21.
To Fluff,
You must be happy with England at the moment, which is more than I can say for the Wallabies.
Dave.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,038
Messages
6,128,450
Members
449,453
Latest member
jayeshw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top