How to get only the top row from multiple tabs into a new tab?

Angeljot Dhng

New Member
Joined
Feb 26, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I have multiple tabs of each city which include the information of that specific city. The question is I want to fetch only the top row from each city tab into a new tab that includes city names that are unique.
Example: I have three tabs of cities say NY, DC, and Chicago, each contains information about that particular city. I have made a new tab (let's say the name of the tab is tab_city) with only 1 column (cities) which includes city names NY, DC, and Chicago. I want to fetch only the topmost row of each city from the multiple city tabs into the tab_city tab. Is there any function/formula which does it dynamically like if I drag the formula in the tab_city, automatically the information(only the top row of each city) of other cities comes?
Thank You
PS: If the description is biased, the below link will lead you halfway. Visit:
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Here is one approach, although it uses volatile functions that can cause slow performance if the worksheet is large. This assumes you'll populate column A with the city names that exactly match the tab names. Then drag the formula to the right until it's captured the entire row. You may have to adjust the references depending on which column holds the first value of interest.
MrExcel20210225.xlsx
ABCDEF
1cities
2NY12340
3DC111213140
4Chicago1011021031040
tab_city
Cell Formulas
RangeFormula
B2:F4B2=OFFSET(INDIRECT("'"&$A2&"'!$A$1"),0,COLUMN(B$1)-COLUMN($B$1))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

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