Solved

OFFSET - What replaces it

Posted on 2011-09-13
8
372 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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 125 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

706 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

19 Experts available now in Live!

Get 1:1 Help Now