# Formula To Find Date Closest To Today?

Apr 9, 2014
I cells B5:B15 I have a list of dates from last year. I need a formula that I can put in cell D5 that gives me the date that is closest to the same day last year.

Example:

If today is 4/9/14

and

From B5:B15 there were the following dates:

3/12/13

3/19/13

3/29/13

4/5/13

4/8/13

4/12/13

5/6/13

5/29/13

Cell D5 would contain

4/8/13 since it is the date closet to same day last year.

View 4 Replies
ADVERTISEMENT
Jun 23, 2014

I have the following table of stocks with corproate action types and dates with a ticker / identifier per stocA1:

Type

B1:

ID

C1:

Date

[Code]....

I am trying to find the NEXT Dividendcorporate action that is CLOSEST to the current date. I've done some google trawling and found a few formulae that seem to work only if the identifiers or dates are in a particular order. ALso having trouble using TWO criteria

View 1 Replies
View Related
Dec 26, 2012

I have a list with all our company cars (300). I also have a list with all the transactions of the fuel cards (12000 lines). Now I need the find for every company car (exact match) the nearest fuel-consumption-date (closest match to the given starting date) and take the mileage of that transaction. I've added an example. I have tried linking carnr and date (like carnr&"#"&date) and match these, but I don't always get the right car number.

View 1 Replies
View Related
Dec 19, 2009

I am looking for a formula to return the expected row/location in range B2:B13 as shown in col. F

Col. B dates are and cannot be sorted

The idea is to find the exact or the closest lower date to those in col. E

as per two criterias (col. D+E)

I prefer no helper column and no macro

(see attached WB)

View 14 Replies
View Related
Oct 30, 2009

I am working on payment/cost estimator and am looking for some ideas and formula or macro help. Basically what I am trying to do is set up a calculator where you would input the payment you could afford and it will tell you how much you can spend on the equipment.

The problems I am running into are that when you factor in the interest rate and commission, the payments are round numbers so I need the formula to find the closest value.

Example- $250 payment. The payments in the table w/ the interest rates are $158, $248 and $350. I would need it to pick the corresponding equipment cost for the $248 payment.

Make sense?

If a macro would be easier I am fine with that, just have limited experience setting one up.

View 9 Replies
View Related
May 1, 2014

I am trying to find the difference between two dates.

Column B consists of date (oldest to latest), Column C to Column P consists of data, I have entered formula in Column Q to get value if the conditions are met, else the cells will remain blank (but those cells contains formula)

For eg: =IF(C4395=1,J4395,"")

There are thousands of ROWS in the worksheet.

I need to find last value in the Column Q, corresponding date (assuming if the last value is in Q4395, I want it's corresponding date which is in Column B) and finding the difference between today and that found date. All these put together in one formula.

I managed to get last value in the column by using this formula, but I couldn't get it's corresponding date.

=LOOKUP(9.99E+307,Q2:Q4418)

View 5 Replies
View Related
Mar 5, 2014

My need is if i press one macro button it will select today updated cell. Is there any macro code for find today date?

View 3 Replies
View Related
Mar 9, 2014

I may be making this more complicated than it needs to be but I can't seem to figure it out. The goal of this spreadsheet is for General Managers of a restaurant to give feedback about food deliveries. These deliveries usually come on Monday, Thursday, and Saturday, but could for a list of reasons come on any day of the week. I want to automatically populate as much information as possible without requiring GMs to remember and enter dates.

A1 is =TODAY()

A2:A5 is a drop down where the GM selects the day of the week the delivery arrived. i.e. MON, TUE, WED, etc. I want the corresponding date of the past week to auto-populate in this cell (or even the adjacent cell if necessary) once the day is selected. For example, if today is 3/8/2014, when MON is selected in A2, I want the cell to automatically add "3/3/2014," making the entire cell read "MON 3/3/2014."

So if said GM is filling in this spreadsheet on a Saturday, and I want to display the date of the previous Monday, I need to find the day of the week of A1 (WEEKDAY function), and make A2 = A1-5.

If today is a Friday, it would be A2=A1-4, and so on for the 7 days of the week.

Then I would need to do all of this for if a Tuesday is selected in the drop down box, meaning IF(Saturday)Then A2=A1-4, etc...

I was trying to string together IF statements like this:

=IF(WEEKDAY(TODAY()=7),A1-5), IF(WEEKDAY(TODAY()=6),A1-4)

It works when I do only the first IF statement, but when I add another it returns #VALUE. I thought that excel would find the first true value and stop evaluating.

View 2 Replies
View Related
Jan 17, 2013

Cell B1 contains a date, then B2 contains a formula that says:

=IF(A1>TODAY(),A1,A2)

A1 contains a green tick and A2 contains a red cross.

What I am trying to add is that if B1 contains no date then B2 needs to be blank.

I tried using =IF((A1="",0),(A1>TODAY(),A1,A2) to get it to show a 0 if there was no data but this doesn't work.

I am using Excel 2003.

View 4 Replies
View Related
Apr 16, 2014

I have a formula

=AL260-WEEKDAY(AL260,2)+MATCH(AP260,{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},0)

The formula looks at the chosen start date (AL260), and then uses a displayed text day (AP20) to display the relvent date to the text day, this works fine however if the start date is say 08/08/14 (a Friday) when the formula detects a Monday (this copies down a range looking at the start date and the text days to produce dates on each line, the formula displays the Monday dates prior to start date, is there any way to alter this to make it display the dates ahead of the chosen start date?

View 10 Replies
View Related
Mar 31, 2009

this is my first post and i was a little unsure as to whether to put this in the General or VB/Macros forum, because it kind of involves both.

i'm trying to write a macro that inserts a formula that uses the date of the day that it was run (that is, i don't want it to be volatile like TODAY() and NOW(), but i don't want to have to manually type in the date into each formula).

is there a way that i can write a formula that uses the date of the day it is entered into the cell, or write a macro that adds today's date (perhaps using ActiveCell.Value = Date) and then writes a formula around that?

View 9 Replies
View Related
Apr 25, 2014

I'm in Excel 2010, and the cell with the date I want to work from is H22.

I'm trying to get the difference of the (date+12 months)-TODAY() to appear in months and days.

Here's the latest thing I tried (that doesn't work):

=IF(DATEDIF(H22,TODAY(),"y")>=1,DATEDIF(H22,TODAY(),"y")&" yrs, "&DATEDIF(H22,TODAY(),"ym")&" mths,

"&DATEDIF(H22,TODAY(),"md")&" days",IF(DATEDIF(H22,TODAY(),"ym")>=1,DATEDIF(H22,TODAY(),"ym")&" mths, "&DATEDIF(H22,TODAY(),"md")&" days",DATEDIF(H22,TODAY(),"md")&" days"))

I should also probably note that the date in H22 is the result of another function.

=EDATE(G22,12)

View 5 Replies
View Related
Apr 4, 2008

how to make the data look like a table with three columns. Other than the date, it is space delimited. I have a tracking spreadsheet where Column A is populated with dates for the year. Column C contains daily values.

I don't always start entering daily values on the first day of the year, e.g., this year the first value in Column C corresponds to March 9. All values in Column C are contiguous - there are no blank cells until the value in Column A is greater than today's date code. I would like to use a formula (rather than VBA) to look down Column C and find the first non-blank entry where the value in Column A is less than or equal to today(). In this case, the formula should return the value for March 9, 2008.

CREATE TABLES LIKE BELOW?Column A Column B Column C

March 1, 2008Saturday

March 2, 2008Sunday

March 3, 2008Monday

March 4, 2008Tuesday

March 5, 2008Wednesday ...................

View 4 Replies
View Related
Feb 10, 2013

Essentially I have three columns.

Column 1 is the name of a property

Column 2 either says "Primary" or "Secondary"

Column 3 has a date of when some building work is due to be completed.

I need a formula that can tell me how many entries there are in the second column of "primary" sites that have a completion date that is less than the current date.

View 3 Replies
View Related
Jan 16, 2008

I tried searching through the forums, but I don't exactly know how to word my question!

I have a workbook with two sheets: Meetings and MasterStatus

On the both sheets I have taskID for a specific task.

On the MasterStatus sheet, I want to use an array to look up the next meeting date for each taskID (Column C), referencing the Meetings sheet (Column E) to do so.

The formula I have so far doesn't work:

=MIN(

IF(

AND(

Meetings!$A$2:$A$3000>TODAY()-1,

NOT(ISBLANK(Meetings!$A$2:$A$3000)),

Meetings!$E$2:$E$3000=$C$7),

Meetings!$A$2:$A$3000,

0

)

)

View 9 Replies
View Related
Feb 17, 2009

I’ve been searching the forum but am struggling to find exactly the information I need!

I’m trying to get a column of cells to update with the date that the cells contents change to “Y”. I had been using the formula =IF(I7="Y",TODAY(),"-") in cell J7 but this updates the date every day. I need this date to remain the same as when it’s first populated.

I’ve been trying to cut and paste text from existing posts into the Visual Basic code but am new to this so am not getting the results I need. I had tried:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

'will put date in column B when something is put in A

If Target.Column = 9 Then

Target.Offset(0, 1).Value = Date

End If

End Sub

But this caused all sorts of problems! I then tried messing around with:

Option Compare Text

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

On Error GoTo enditall

Application.EnableEvents = False

If Target.Column = "I" Then

If Target.Value = "Y" Then

Excel.Range("J").Value = Date

End If

End If

enditall:

Application.EnableEvents = True

End Sub

But this doesn’t work either. In fact, both these codes are probably riddled with errors as I’ve been trying to learn by trial and error!

View 9 Replies
View Related
Jan 21, 2014

I have a large spreadsheet with a long date range from A:3 to A:900

what would be the best way to jump to today's date? I have seen formulas, Macro's, Active X controls, Hyperlinks?

View 9 Replies
View Related
May 8, 2014

I have made the macro that does as ,soon as i open the file, select today's date but only if date is in sheet5... sheet 5 is may so it works. Doing the same job for every sheet in the file.

View 10 Replies
View Related
Dec 4, 2009

I need to find which number in a row would be closest to zero, then display the associated name. The number can be negative. I used this, which works well if all the numbers are positive: =INDEX($C$1:$E$1,MATCH(MIN(C66:E66),C66:E66,0)). I'm running into a problem when the closest number is negative.

View 2 Replies
View Related
May 6, 2009

In the attached sheet, I am using !Staff times columns N and O to nominate a mid point break time relevant to the start,lunch break and finish times of a shift.

What I would like to do is match the result to the closest time from !Race Times Column D (highlighted green). So if for example the mid point of the shift is 10:37 (as in !Staff Times cell N23), it actually comes back with the !Race Times result of 10:35 which is the closest actual race.

Ideally I would like it to look both sides of the midpoint time until it came to the closest match, rather than always looking at an earlier time, or always a later time (eg the cell N79 has a value of 11:36, however the 2 race times are 11:35 and 11:40. Preference is it shows 11:35). If however the N79 result was 11:38 or 11:39, I would prefer it went to 11:40).

However if this is not possible then picking the next time in either direction will do.

View 4 Replies
View Related
Aug 14, 2013

Say i had a col of random numbers, and their corresponding probabilities of occurring;

-32.33

0.001497

-35

0.001523

-32.06876

0.001551

-29

0.001579

10

0.001607

7

0.001636

-31.54628

0.001665

-18

0.001695

Neglect the nature of the sample, its just gibberish and not of concern here. The question is, if i enter a value in column C, how do i find the closest corresponding number to it in col A, and subsequently return its nearest corresponding probability from col B? For example, say i entered 8 in C1, then the formula would need to find the closest number to 8 in col A, which is 7, and return from col B the value of 0.001636.

View 1 Replies
View Related
Jun 30, 2009

Got an equation nightmare on my hands.

So i have 3 columns of data

A: State Abbreviate

B: Benchmark Number

C: New Number

I am trying to get an equation that in column D will return the 2 .....

View 11 Replies
View Related
Nov 19, 2009

I have data going in to a small table which has some empty rows as that data is not yet available... My problem is, I need to sort this table in date order but with the date nearest to today's date at the top...

The sort function puts oldest at the top or oldest at the bottom which is no good for what I need...

I use xl 2003.

View 9 Replies
View Related
Jun 26, 2008

I am wondering if it is possible to search a column full of assorted values which is unsorted, and then return the closest value.

I have written a previous thread which was similar, but misleading, i feel this thread is more to the point.

Currently i use this code, but it only finds the closest highest value if the data is sorted in ascending order.

View 14 Replies
View Related
May 24, 2006

I needed to know how to find the closest match to a reference number

regardless of whether its larger or smaller. I did a search and found a post

back in March that said to use the following:

=SUMPRODUCT(((ABS(list-target))=MIN(ABS(list-target)))*list)

I applied it to my application and it works, I just have no idea why. Can

anyone explain this formula to me or tell me where I can find a good

resource.

View 11 Replies
View Related
Oct 4, 2011

I have a database where I have groups defined. For example, Parent 0001 is called Bag1. It contains an apple, orange, grape, and a pear. Parent 0002 is called Bag2, containing an apple, orange, and a peach. So on and so on...

Below is an illustration of what I explained above:

Parent

Level

Description 0001

1

Bag1 0001

2

apple 0001

2

orange 0001

[code]....

I need a way to input items that are in the groups and find the groups have all of the items or the group with the best match. I need to know if the match is 100% or if it is only a partial match.

The bag might have 2 items or it could have 20 items and they can be in any order.

View 4 Replies
View Related
Jun 19, 2014

I have modified some code I found in these forums that once I enter a value in a cell I can have it find the closest match to that value and scroll down the list and paste that value as an offset. The code works perfectly, but my data will often contain the same values repeated and these aren't duplicates and I need to know how to loop the code to ensure it doesn't just find the first value but also the second (if the first is already populated) Code is:

Sub findclose()

Dim rng As Range, Dn As Range, Mx As Single, oAd As String

Dim num As Range

Set num = ActiveSheet.Range("B1")

[Code] .......

---- What I need to do is insert a loop of some sort that basically says IF my offset cell has a value then to find the next closest amount and continue the macro.

So if my list was:

700

50

500

600

500

And I wanted to find 499 then my list would look like:

700

50

500 499

600

500

BUT if I wanted to match off another amount of 501 it would keep the 499 it found and then find the 501 making the completed list look like:

700

50

500 499

600

500 501

Right now the amounts are being overidden as I don't know how to loop it...

View 6 Replies
View Related
May 12, 2009

I have a sheet of pump test results, placed in rows, where the test rig is set at a specific speeds and flow and it records pressure. At each stage of the test a number of snapshots will be taken (Usually between 3-5 at each stage), so I have 3-5 rows of very similar data. I only need to use the best row from the selection available, so I am hoping to find a formula or code (Don't care which) that can look at the results and select the row of readings where the speed AND the flow are closest to the targetted data.

For example: In cells G6:G8 I have flow result values 0.129, 0.151, 0.156 and in H6:H8 I have speed result values 72.536, 71.82, 72.13. These are actuals. In cell N6 I have the target speed (75) and in O6 I have flow target (0.15), but these could be moved anywhere to suit really. What I was hoping to do, but am struggling big time, was to just flag up the row of readings where these two values are closest to the targets by placing a check mark in column L:L which I have formatted in monotype sorts and would like to place a "4" (Which gives me a check mark) on the 'best' row. From that I can do more with some simple IF statements.

Is this feasible, or am I trying to do something beyond Excels capability, it is certainly beyond mine at the moment. I was looking at the check mark method, but that is not essential, so if anyone has any suggestions on an alternative means of identifying the best row of data, that might make it easier to do, then I am listening.

View 9 Replies
View Related
Dec 9, 2013

I'm looking for a way to split a cell with text into two cells. The first cell can only contain up to 40 characters, the rest needs to go in the second cell. However, I don't want the text to be split in the middle of a word. So basically, if the text is in cell A1, I need to find the closest space to the left of position 40 in A1, and move anything to the right of this position to B1. Example:

Original text:

A1: One green apple and a bucket of small onions that smell nice

I want to avoid this:

A1: One green apple and a bucket of small on

B1: ions that smell nice

I want to achieve this:

A1: One green apple and a bucket of small

B1: onions that smell nice

View 4 Replies
View Related
Apr 9, 2014

I have a list with random ordered numbers (each number in a cell of a row): 1, 2, 6, 8, 11, 12, 16...

On the other hand I get a value (x). I want a formula that:

- If x is in the list, returns x

- If x is not in the list, returns the next higher value. For example, if x=8, returns 11

I want also a variation of the same formula, that returns the next lower value. For example, if x=8, returns 6.

Note that x will never be smaller than the first number on the list or higher than the highest number in the list.

View 1 Replies
View Related