Solved

Pivot Range Question

Posted on 2014-11-17
5
75 Views
Last Modified: 2014-11-19
Rob Henson solved a previous question for me relating to the issue of ranges changing when new data is imported into the spreadsheet. The answer was:

=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNTA(Sheet1!$1:1))

I figured I would be able to make a slight change to this when the range is a single column [Wrong]

So experts, please explain how to make a named range in a single column always pick up up all of the data.

And just to clarify I have 3 ranges Bref, Sub and Source which I then refer to in the below formula.

=1/SUMPRODUCT(--($M$6:Bref=M6),--($P$6:Sub=P6),--($I$6:Source=I6))

and my problem is that if the total number of rows imported last was say 260 when I import today and there are 320 the ranges do not increase to 320.

Thanks
0
Comment
Question by:Jagwarman
  • 2
  • 2
5 Comments
 
LVL 50

Expert Comment

by:teylyn
ID: 40446789
Hello,

the formula provided above will create a range that starts in A1 and spans all used columns.

If you only need one column and you know the column letter, say column C, you could use

=OFFSET(Sheet1!$c$1,0,0,COUNTA(Sheet1!$c:$c),1)

If column C may contain blanks, but column A always has data in each row, you may want to use column A for the vertical sizing of the column, like this:

=OFFSET(Sheet1!$c$1,0,0,COUNTA(Sheet1!$a:$a),1)

In words that formula means: Start in cell C1, go 0 cells down, go 0 cells to the right. Make the selection as high as there are populated cells in column A and make the selection one column wide.

Note that with the CountA function the returned range will be too short if there are blank cells in column A. There are other ways to determine the last used cell in column A (or C). You should be fine if there are no blanks in the data.

cheers, teylyn
0
 

Author Comment

by:Jagwarman
ID: 40446806
Hi teylyn

I tried to put this in so that my formula would look at it. [my formula is =1/SUMPRODUCT(--($M$6:Bref=M6),--($P$6:Sub=P6),--($I$6:Source=I6))  ]

So I presumed I would change Bref in Name Manager to =OFFSET....... but this does not work.

Clearly this is not what I should be doing.
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40446956
Jagwarman

Your SUMPRODUCT formula is effectively trying to create a range with 3 parameters

M6:RangeStart:RangeFinish

If Bref is creating a Range then you would only need (Bref=M6) for that part of the formula.

if you want the Range to start at M6 then the OFFSET function would start:

=OFFSET(M6,....

Thanks
Rob H
0
 
LVL 31

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 40447245
So if I am extrapolating correctly:

Bref  refers to:

=OFFSET($M$6,0,0,COUNTA($M:$M),1)

Sub refers to:

=OFFSET($P$6,0,0,COUNTA($P:$P),1)

Source refers to:

=OFFSET($I$6,0,0,COUNTA($I:$I),1)

This assumes there is nothing above row 6 in each of the columns.

Formula would then be:

=1/SUMPRODUCT(--(Bref=M6),--(Sub=P6),--(Source=I6))

Thanks
Rob H
0
 

Author Comment

by:Jagwarman
ID: 40447266
Thanks Rob that is what I needed. Can't close from this PC will close later.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now