Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pivot Range Question

Posted on 2014-11-17
5
Medium Priority
?
86 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 50
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 33

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 33

Accepted Solution

by:
Rob Henson earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

705 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