Getting sum total based on date input

gd6noob

New Member
Hi,

Im trying to get the sum total based on the Date input at D3 here is my formula =SUM(INDIRECT("Data!"&ADDRESS(MATCH($C5,Data!B:B,0),MATCH($D$3,Data!$1:$1,0))&":"&ADDRESS(MATCH($C6,Data!B:B,0)-1,MATCH($D$3,Data!$1:$1,0))))

The problem Im facing, in this example, the Data tab is auto pulled from the web and my formula only works if the Date remains on row 1 and the sports remain in column b.
On my actual workbook, the site Im pulling data from, does not allow me to select which part but the whole page, like I normally can with most other sites. The actual data wont fall under these conditions and will in different rows and columns.
Is there another way to do this?



 

Rijnsent

Well-known Member
Hi Gd6noob,
If your data is at a random spot in the sheet, you probably first need a function (or two) to find out where the data starts. You could use a couple of MATCH formulae to e.g. find "Hockey" if that's a good indicator of where your data starts. You could then use that found row/column to build your formula. By the way: the OFFSET formula also allows you to select a region (width & heigth are two parameters).
Generally speaking I would try to build some VBA to pull in the data on a fixed location, that makes life so much easier :).
Hope those pointers help,
Koen
 

gd6noob

New Member
Hi Rijnsent,

The data in the Data tab doesnt always come to a random spot, its in a fixed location further down, row 396, but my formula, for some reason needs to be in this row/column. Ive tried to manipulate it but returns a #N/A error.
 

Some videos you may like

This Week's Hot Topics

  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • find many based on a certain criteria
    good evening, I hope someone can help me? I have a workbook sheet 2 contains lots of data.... I would like to be able to find anything on sheet...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
  • Text Format
    I have a sheet for user to keyin the data. The format of the data can be 451 / 1903, 0012 / 9908 or 00287 / 0099. The number after the "/" is...
  • Syntax errors
    Good Morning, Trying to compile a workbook, I keep getting a few errors. Here are the first two: [code=rich]Syntax Error: Function...
Top