If a value is exceeded, place date it exceeded

chachie

New Member
Joined
Nov 21, 2006
Messages
10
Hello,

I have 4 columns A, B, C, and D. Collumn A is a datetime data set and the other 3 are various other number data sets. I would like to enter a value in a cell under column F, G or H and the VLookup would look through columns B, C or D respectively to see if the value was exceeded. If yes, it would input 'yes' in the cell and post the datetime it occurred next to it.

I'm trying Vlookup but it seems like the greater than option isn't possible. So far I'm using this formula: =VLOOKUP(F8,B14:D70,-1,FALSE) but I just get #N/A as a result.

No sure if I'm explaining myself properly but I appreciate any help you guys could provide.

Thanks
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Do you want to compare column F to column B, column G to column C and column H to column D? Also, do you want the "Yes" and the time stamp in the same cell that you enter the value? Please clarify.
 
Upvote 0
Do you want to compare column F to column B, column G to column C and column H to column D? Also, do you want the "Yes" and the time stamp in the same cell that you enter the value? Please clarify.

Yes, a value entered in a single cell in column F is compared to values throughout column B, cell in G to column C and cell in H to column D.

The "yes" result can be in one cell and the time stamp in the cell next to it.

I'm thinking it may be a combo of "if" and "vlookup" commands but my excel-fu is not strong.
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a value in column F, G or H and press the RETURN key.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("F:H")) Is Nothing Then Exit Sub
    If WorksheetFunction.Max(Columns(Target.Column - 4)) > Target.Value Then
        Target.Offset(, 1) = "Yes"
        Target.Offset(, 2) = Now()
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,826
Messages
6,181,192
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top