Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

OFFSET - What replaces it

Posted on 2011-09-13
8
Medium Priority
?
394 Views
Last Modified: 2012-05-12
Hello Excel Experts,

I have a spreadsheet that uses OFFSET.  The OFFSET was used to read a cell that had a formula and now that cell is static so the OFFSET no longer works.  My question is what should I use instead of OFFSET for a static value?  The following is the formula:
=IFERROR(SMALL(OFFSET($M$2,0,0,COUNT($L:$L),1),COLUMN()-COLUMN($M$2)),"")
0
Comment
Question by:CompTech810
  • 4
  • 4
8 Comments
 
LVL 50

Expert Comment

by:barry houdini
ID: 36529763
OFFSET is actaully giving you a range, not a single cell (unless COUNT($L:$L)=1), so perhaps you just want a static range like M2:M100, i.e.

=IFERROR(SMALL($M$2:$M$100,COLUMN()-COLUMN($M$2)),"")

regards, barry
0
 
LVL 2

Author Comment

by:CompTech810
ID: 36529915
I do need the the count.  The formula counts down a column looking for unique dates and writes them as a heading.
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36530145
.....but the COUNT function supplies the "height" parameter within the OFFSET function, if you remove OFFSET as requested then COUNT won't be there.

OFFSET defines a range that starts at M8 and is as long as the number of numbers in column L (supplied by COUNT).

Can you explain why the original doesn't work?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Author Comment

by:CompTech810
ID: 36530422
The original OFFSET works if the value in the cells are a formula to provide a date based on another column.  If the date value is a static date the OFFSET does not show a result.  I did some checking on OFFSET and I read that it uses the VALUE of the cell.
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36530546
OK, let me just give a small explanation of the formula....

=IFERROR(SMALL(OFFSET($M$2,0,0,COUNT($L:$L),1),COLUMN()-COLUMN($M$2)),"")

Let's ignore the IFERROR part, that just returns a blank if the main formula returns an error, so without that we have

=SMALL(OFFSET($M$2,0,0,COUNT($L:$L),1),COLUMN()-COLUMN($M$2))

This is a fairy basic SMALL function of the form

=SMALL(range,n)

where the OFFSET function supplies a range and COLUMN()-COLUMN($M$2) supplies n.

For your formula to work all that you need is for there to be valid numbers in the range supplied by OFFSET (dates are simply formatted numbers).

The formula should work fine whether the range defined by OFFSET is filled with dates that are generated by formulas or manually entered unless they aren't real dates

How are the dates entered/what do they look like? Assuming M2 contains a date what do you get with this formula in a blank cell

=ISNUMBER(M2)

Has column L changed - there need to be numbers in there to help define the range for your OFFSET function.

If the above doesn't help can you possibly attach the workbook or a version of it?

regards, barry
0
 
LVL 2

Author Comment

by:CompTech810
ID: 36531295
I tried the =ISNUMBER(M2) and =ISNUMBER(L2) and both are false.

I have attached the file that is not working (sample1) and the one that is working (sample2).
Sample1.xlsx
Sample2.xlsx
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36531759
Yes, a FALSE result for ISNUMBER means that it isn't recognised as a date/number.....which messes up the SMALL function which only looks at numbers....

I followed this to convert column L to numeric

Select column L > Data > Text to columns > Next > Next > under "column data format" select "date" and "DMY" option > Finish

I then formatted that column as mm/dd/yyyy - these are now valid dates, so the OFFSET formula should work - I tweaked it slightly to use this version in N1 copied across

=IFERROR(SMALL(OFFSET($M$2,0,0,COUNT($L:$L),1),COLUMNS($M2:M2)),"")

...and I also changed your COUNTIF formula slightly for column M as that was causing a circular reference - in M2 copied down

=IF(COUNTIF(L$2:L2,L2)>1,"",L2)

see attached

Does that do what you need? If you add dates to column L now manually they should be OK as long as you enter a valid date format

regards, barry
27305439.xlsx
0
 
LVL 2

Author Comment

by:CompTech810
ID: 36538049
Hmmm, that's odd.  I selected date format.  Wonder why it doesn't recognize it as a number.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

927 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