If cell contains a date then link to another cell

Danskylansky

New Member
Joined
Mar 10, 2016
Messages
2
Hi All

I am trying to use an If statement to return a particular amount if a corresponding cell, on another table has a date (only - if it contains anything else i need it to be blank. Here are the tables:
Table 1:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Initials[/TD]
[TD]Day 0[/TD]
[TD]Day 7[/TD]
[TD]Day 14[/TD]
[TD]Delivery[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]$500[/TD]
[TD]$300[/TD]
[TD]$800[/TD]
[TD]$1500[/TD]
[/TR]
[TR]
[TD]M001[/TD]
[TD]$500[/TD]
[TD]$300[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]M002[/TD]
[TD]$500[/TD]
[TD][/TD]
[TD][/TD]
[TD]$1500[/TD]
[/TR]
</tbody>[/TABLE]
Table 2:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[/TR]
[TR]
[TD]Initials[/TD]
[TD]Day 0[/TD]
[TD]Day 7[/TD]
[TD]Day 14[/TD]
[TD]Delivery[/TD]
[/TR]
[TR]
[TD]M001[/TD]
[TD]01/01/2016[/TD]
[TD]05/02/2016[/TD]
[TD]08/03/2016[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]M002[/TD]
[TD]03/01/2016[/TD]
[TD]NA[/TD]
[TD]NA[/TD]
[TD]12/03/2016[/TD]
[/TR]
</tbody>[/TABLE]

I need the correct IF Statement to be applied on the first table: =if('table2'B2=date,'table1'B2,""). I realise that just using =date is not correct, but can't workout the correct function name to use
My problem is getting the if statement to only recognise if a date has been used in the corresponding cell.

Any help would be appreciated

Thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
try

=if(isnumber('table2'B2),'table1'B2,"")
 
Upvote 0
Code:
Function dat(ByVal r As Range) As Boolean
If r.NumberFormatLocal = "mm/dd/yyyy" Then
dat = True
Else
dat = False
End If
End Function
=if(dat('table2'B2),'table1'B2,"")
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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