Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Location: I live in Malta, a lovely little Island in the centre of the Mediterranean sea
Posts: 2
Default Time and Vlookup Problem

Hi Everyone, I have a problem in Microsoft Excel and I hope someone will find a solution for me.

In cell A1 I have =Today()
in cell B1 I have a code that gives me the time in real time
From cells E6:E369 I have a calendar
From Cells H6:H369 I wrote this formula,
IF(ISNA(VLOOKUP(E6,$A$1:$B$1,2,FALSE)),0,VLOOKUP(E 6,$A$1:$B$1,2,FALSE))
This gives me a '0' where the date does not match and the time where the date matches.
Is there a way of how I can keep the time in the matching cell without
changing (i.e. stopping the clock in the relevant cell) and keep the result even when the date changes the next day.

Thank you
Albert
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Time and Vlookup Problem

Hi,

You will need to code this with VBA, you will have to convert the formula
to a value anytime there is a match. Once converted the formula will be
lost, is that acceptable?
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"AlbertMBartolo" wrote:


Hi Everyone, I have a problem in Microsoft Excel and I hope someone will
find a solution for me.

In cell A1 I have =Today()
in cell B1 I have a code that gives me the time in real time
From cells E6:E369 I have a calendar
From Cells H6:H369 I wrote this formula,
IF(ISNA(VLOOKUP(E6,$A$1:$B$1,2,FALSE)),0,VLOOKUP(E 6,$A$1:$B$1,2,FALSE))
This gives me a '0' where the date does not match and the time where
the date matches.
Is there a way of how I can keep the time in the matching cell without

changing (i.e. stopping the clock in the relevant cell) and keep the
result even when the date changes the next day.

Thank you
Albert




--
AlbertMBartolo

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Time and Vlookup Problem

Hi,

Here is the code:

Sub ConvertToValue()
Dim cell As Range
For Each cell In Range("H6:H369")
If cell < 0 Then
cell.Value = cell
End If
Next cell
End Sub

However, you could attach this to the Workbook_Open even or
Workbook_BeforeSave event or many others. Otherwise you will need to run it
manually, which is certainly ok.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"AlbertMBartolo" wrote:


Hi Everyone, I have a problem in Microsoft Excel and I hope someone will
find a solution for me.

In cell A1 I have =Today()
in cell B1 I have a code that gives me the time in real time
From cells E6:E369 I have a calendar
From Cells H6:H369 I wrote this formula,
IF(ISNA(VLOOKUP(E6,$A$1:$B$1,2,FALSE)),0,VLOOKUP(E 6,$A$1:$B$1,2,FALSE))
This gives me a '0' where the date does not match and the time where
the date matches.
Is there a way of how I can keep the time in the matching cell without

changing (i.e. stopping the clock in the relevant cell) and keep the
result even when the date changes the next day.

Thank you
Albert




--
AlbertMBartolo

  #4   Report Post  
Junior Member
 
Location: I live in Malta, a lovely little Island in the centre of the Mediterranean sea
Posts: 2
Smile

Thank You ever so much Shane, it worked perfectly, exactly what I wanted. But sorry I can not find the Yes button

Quote:
Originally Posted by Shane Devenshire[_2_] View Post
Hi,

Here is the code:

Sub ConvertToValue()
Dim cell As Range
For Each cell In Range("H6:H369")
If cell < 0 Then
cell.Value = cell
End If
Next cell
End Sub

However, you could attach this to the Workbook_Open even or
Workbook_BeforeSave event or many others. Otherwise you will need to run it
manually, which is certainly ok.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"AlbertMBartolo" wrote:


Hi Everyone, I have a problem in Microsoft Excel and I hope someone will
find a solution for me.

In cell A1 I have =Today()
in cell B1 I have a code that gives me the time in real time
From cells E6:E369 I have a calendar
From Cells H6:H369 I wrote this formula,
IF(ISNA(VLOOKUP(E6,$A$1:$B$1,2,FALSE)),0,VLOOKUP(E 6,$A$1:$B$1,2,FALSE))
This gives me a '0' where the date does not match and the time where
the date matches.
Is there a way of how I can keep the time in the matching cell without

changing (i.e. stopping the clock in the relevant cell) and keep the
result even when the date changes the next day.

Thank you
Albert




--
AlbertMBartolo
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLookUP Problem with Time Comparision DaveM Excel Discussion (Misc queries) 10 January 4th 09 07:54 PM
Vlookup problem with Date Time normajmarsh Excel Worksheet Functions 0 February 3rd 06 07:33 PM
Problem in using Vlookup (1st time user) navneetjn Excel Worksheet Functions 13 July 19th 05 03:26 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Excel Worksheet Functions 4 November 18th 04 03:24 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Excel Worksheet Functions 0 November 18th 04 03:13 PM


All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"