Repeating formula help

Bound4Glory

New Member
Joined
Jun 21, 2020
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hello,
I have about 100 pages on work sheet 1. At the top of each page I have 5 rows that I need extracted from a table on work sheet 2. There are 63 rows on each page. I basically need the formula to repeat every 63 rows and increase by 1 row from the table.

Anyone know how I can repeat the formula without having to copy and paste each one and then changing the numbers manually?

Work sheet 1 - Page 1
Date:Friday, September 3, 2021
Origin:PENNWOOD PLACE (PA) P&DC
Route:150AD
Trip:3003
STA:15:00

Work sheet 1 - Page 2
Date:Friday, September 3, 2021
Origin:P60S CHICAGO STC
Route:602M5
Trip:707
STA:15:15

Work sheet 2 - Table
150AD 300309/03/2021 15:00:00150PM PENNWOOD PLACE (PA) P&DC
602M5 70709/03/2021 15:15:0060S CHICAGO STC

Thank you for your time
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi Bound4Glory,

Does this do what you want?

Cell Formulas
RangeFormula
A2:A4A2=IF(ROW()-1>COUNTIF(Sheet1!A:A,"Origin:"),"",INDEX(Sheet1!C:C,((ROW()-2)*63)+3)&" "&INDEX(Sheet1!C:C,((ROW()-2)*63)+4))
B2:B4B2=IF(A2="","",TEXT(DATEVALUE(MID(INDEX(Sheet1!C:C,((ROW()-2)*63)+1),FIND(",",INDEX(Sheet1!C:C,((ROW()-2)*63)+1))+2,99)),"m/d/yyyy")&" "&TEXT(INDEX(Sheet1!C:C,((ROW()-2)*63)+5),"hh:mm"))
C2:C4C2=IF(A2="","",INDEX(Sheet1!C:C,((ROW()-2)*63)+2))
 
Upvote 0
I don't think I did I great job explaining it, but I think you're on the correct path for what I need. Here is a better example below. I'm just wondering if there is a quick method to do this or will I have to copy and paste the formulas all the way down?

SHEET1
sheet1data.PNG
SHEET2
sheet2data.PNG

Thank you
 
Upvote 0
So you want the reverse of what I supplied?
Create Sheet1 from Sheet2?
 
Upvote 0
Yes, I think you did it backwards and I am having a hard time figuring out the formula.
 
Upvote 0
You're latest example is inconsistent. It appears you've changed from 63 rows per set to either 9 or 10 rows per set. This solution will give 9 rows per set.

So this creates Sheet1 from Sheet2.
It supports up to 999 entries in Sheet2 and you'll need to copy down the Sheet1 A and B formulae at least as far as Sheet2 entries multiplied by 9 (as I note you've switched from 63 rows to 9 rows).

Bound4Glory2.xlsx
ABC
1ROUTE TRIPDATE TIMEORIGIN
2150AD 30039/3/2021 15:00PENNWOOD PLACE
3602M5 7079/3/2021 15:15P60S CHICAGO
4640L 46019/3/2021 15:20KANSAS City
5
Sheet2


Cell Formulas
RangeFormula
A1:A25A1=IF(ROW()>(9*COUNTA(Sheet2!$A$2:$A$999)),"",CHOOSE(MIN(6,MOD(ROW()-1,9)+1),"Date:","Origin:","Route:","Trip:","STA",""))
B1:B25B1=IF(ROW()>(9*COUNTA(Sheet2!$A$2:$A$999)),"",CHOOSE(MIN(6,MOD(ROW()-1,9)+1),TEXT(INDEX(Sheet2!$B$2:$B$999,INT((ROW()-1)/9)+1)+0,"dddd, mmmm d, yyyy"),INDEX(Sheet2!$C$2:$C$999,INT((ROW()-1)/9)+1),LEFT(INDEX(Sheet2!$A$2:$A$999,INT((ROW()-1)/9)+1),FIND(" ",INDEX(Sheet2!$A$2:$A$999,INT((ROW()-1)/9)+1))-1),MID(INDEX(Sheet2!$A$2:$A$999,INT((ROW()-1)/9)+1),FIND(" ",INDEX(Sheet2!$A$2:$A$999,INT((ROW()-1)/9)+1))+1,99),TEXT(INDEX(Sheet2!$B$2:$B$999,INT((ROW()-1)/9)+1)+0,"hh:mm"),""))
 
Upvote 0

Forum statistics

Threads
1,214,859
Messages
6,121,963
Members
449,059
Latest member
oculus

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