Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-31-2014, 11:23 AM
gbaker gbaker is offline Need help with Index formula Windows 7 32bit Need help with Index formula Office 2010 32bit
Competent Performer
Need help with Index formula
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Need help with Index formula

Hi Bob,


I have attached a sample of what I am trying to do!!!
Attached Files
File Type: zip microsoft lookup date test.zip (80.7 KB, 12 views)
Reply With Quote
  #2  
Old 02-01-2014, 07:47 PM
BobBridges's Avatar
BobBridges BobBridges is offline Need help with Index formula Windows 7 64bit Need help with Index formula Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

I see the problem. You're searching for a particular date in a column that has dates and times; there's no exact match.

Here's why: The timestamp "2014-01-15 22:39:23" is stored in Excel as 41654.9440162037. That's 41654 days from 1900-01-01 — which gets you to the end of 2014-01-14 — plus .9440162037 of another day, which gets you to 22:39:23 of the next day. Never mind that it looks like a year, month, day and time; the format code tells Excel to display it that way, but the internal value is one single large number.

So here you come along and ask the MATCH function to find 2014-01-15. But what Excel sees is 41654—that is, 41654.000—and when it tries to find 41654 in Master-date!B:B, it doesn't see anything that matches than value exactly.

So what do you do about it? Well, here's one way: I created a new column in in Master-date!I:I with formula =INT(B2). This takes the date from column B and throws away the fractional part; what's left is not a date and time, but just the date part. Then I changed the formula in 'Lookup by Date'!H:H to point to column I in Master-date instead of column B, like this:
Code:
=MATCH(R3C3,OFFSET('Master-date'!R1C9:R172C9,R[-1]C,0),0)+R[-1]C
...Oops; I use R1C1 notation by habit. I mean it looks like this:
Code:
=MATCH($C$3,OFFSET('Master-date'!$I$1:$I$172,H7,0),0)+H7
I didn't check for any other errors, but the table all filled in, when I did that, with valid-looking data.

One thing: In column H of 'Lookup by Date', when I made that change, Excel displayed that column of row numbers as dates, eg "5-22". That means row 142, for the reason I explained above. The lookup and the rest of the table works fine, it just looks strange. All you have to do is changed the format of that column to General and it returns to normal.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex Formula using INDEX and Match needed OTPM Excel 5 05-23-2013 01:22 AM
Adding an Index savo Word 1 04-17-2013 06:16 PM
Help with multiple match and index formula ryanwood Excel 1 09-12-2012 07:53 AM
Need help with Index formula Complexed Index elistein Word 1 05-01-2011 06:04 PM
Find and Index cksm4 Word 1 01-03-2011 11:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft