What is the best way to reference data from another sheet to fill in a table on a separate sheet

biggynbp

New Member
Joined
Nov 27, 2022
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
I am trying to create a table to better read the commitment of traders (COT) report. Ive used vllookup to pull from the table to fill in the fields. .The problem I am facing is when I have to update the sheet. I tried to add new columns but found that i have to redo the entire spreadsheet. Does anyone have a way to update the sheet from the source info without having to recreate it each time.

COT Report.xlsx
BCDEFGHIJKL
1CurrencyDate Long Short NON-COM Change Long NON-COM Change Short % Long% Short Net Position Open Interest OI change
2DXY11/15/202238,96512,111(3,922)(583)81%25%26,85448,382(7,958)
3DXY11/8/202242,88712,69458317876%23%30,19356,340398
4DXY11/1/202242,30412,516(2,694)(2,384)76%22%29,78855,942(3,111)
5DXY10/25/202244,99814,900422,63476%25%30,09859,0533,819
6DXY10/18/202244,95612,266(123)(27)81%22%32,69055,234619
7DXY10/11/202245,07912,293630(459)83%23%32,78654,615(23)
8DXY10/4/202244,44912,752(2,975)(4,110)81%23%31,69754,638(1,408)
9DXY9/27/202247,42416,8621,720(911)85%30%30,56256,0461,754
10DXY9/20/202245,70417,773(3,280)4,45884%33%27,93154,292(7,785)
11DXY9/13/202248,98413,315(3,623)(3,185)79%21%35,66962,077415
12DXY9/6/202252,60716,50093534385%27%36,10761,6621,478
13DXY8/30/202251,67216,1572,3611,94586%27%35,51560,1842,576
14DXY8/23/202249,31114,212(1,471)1,39186%25%35,09957,608(1,301)
15DXY8/16/202250,78212,8214472086%22%37,96158,909(730)
16DXY8/9/202250,73812,1012,8203,53085%20%38,63759,6392,585
17DXY8/2/202247,9188,571(3,419)(2,231)84%15%39,34757,054(3,402)
18DXY7/26/202251,33710,8021,103(363)85%18%40,53560,4561,242
19DXY7/19/202250,23411,165(875)(1,590)85%19%39,06959,214(351)
20DXY7/12/202251,10912,755(1,818)(921)86%21%38,35459,565(1,292)
Info
Cell Formulas
RangeFormula
J2:J20J2=D:D-E:E



COT Report.xlsx
ABCDEFGHIJ
1CurrencyNasdaq
2
3Date Long Short NON-COM Change Long NON-COM Change Short % Long% Short Net Position Open Interest OI change
411/15/2022#N/A
511/8/2022
611/1/2022
710/25/2022
810/18/2022
910/11/2022
1010/4/2022
119/27/2022
129/20/2022
139/13/2022
149/6/2022
158/30/2022
168/23/2022
178/16/2022
Test
Cell Formulas
RangeFormula
B4B4=INDEX(Info!B2:L185,MATCH(Test!B1&Test!A4,0))
Cells with Data Validation
CellAllowCriteria
B1List=LKUP!$A$1:$A$4
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Before proceeding, removed the Array formula "=D:D-E:E". Then, with any cell in the data's range hit [Ctrl]T to turn it into an Excel Table. Give the table a name like COT in the Table Name field at the top left of the Table Design ribbon. Now go to the first blank row of the Net Position column and type an "=" then left arrow to the Long column, type a minus, and then arrow to the Short column and hit [Enter]. You should end up with the formula:
Excel Formula:
=[@[ Long ]]-[@[ Short ]]
AND the formula will automatically spill down. New rows added to the table will automatically be included in calculations as well as the scope of any table references.

The reason I went through that is because once you've done that, you can reference the entire table including headers using
Excel Formula:
=COT[#All]
That includes headers and all the data spilling from a single cell.

Columns of data can be referenced like this
Excel Formula:
=COT[Currency]
, individual headers like this
Excel Formula:
=COT[[#Headers],[Currency]]
, and formulas are easier to create, understand, and maintain because the Intellisense will automatically suggest values resulting in formulas like this
Excel Formula:
=XLOOKUP(P25,COT[Date],COT[[ Net Position ]])
. Notice I don't even have to tell you what I was looking up or what I wanted returned.

I think using an Excel Table will solve a lot of your problems.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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