Date Values Not Recognized by Formula

omagoodness

Board Regular
Joined
Apr 17, 2016
Messages
56
I need to lookup a table value based on a date in another cell (V7)
For example Column N has dates and Column P has a currency value in table tblCardTips. (table Columns indexes 1, 3 respectively)
In another cell, V7 there is a date.
I want the formula to match the date in V7 to the same date in the respective table column and then print the corresponding currency value from Amount column in Y7
The code I am using was working fine ut suddenly it returns a 0 even though the value of both dates is the same (43836 for the test date)
VBA Code:
=IF(tblCardTips[@WeekEnd]=V7,tblCardTips[@Amount],0)
I'm a stumped student
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
How are you examining the values of both dates? You say 43836 is the result for both, but some methods of testing automatically convert text versions of date to Excel date serial numbers. You could try altering your formula to :
=IF(tblCardTips[@WeekEnd]=VALUE(V7),tblCardTips[@Amount],0)
 
Upvote 0
How are you examining the values of both dates? You say 43836 is the result for both, but some methods of testing automatically convert text versions of date to Excel date serial numbers. You could try altering your formula to :
=IF(tblCardTips[@WeekEnd]=VALUE(V7),tblCardTips[@Amount],0)
I tested each date cell using
VBA Code:
Value(celladdress)
adding the Value(V7) as you suggested works great. I think I know why. It's nice to get the help and I try to understand the answers so I can code and troubleshoot better as I Learn. Thank you so much.

How do I rate your answer and mark as resolved?
 
Upvote 0
You've already Liked my answer ... so thanks for that. And your reply says solved, so that's letting people see that it's solved.
 
Upvote 0

Forum statistics

Threads
1,215,049
Messages
6,122,864
Members
449,097
Latest member
dbomb1414

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