Help Required....

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear All,
I want macro or formula for the below mentioned querry pls help i am
entering data's in cell A, B and output to be displayed in cell C as follows

A B C
01/11/06 02/11/06 1
NA NA NA
NO NO Voilated
01/11/06 NO Should show no for days from A cell
to today
01/11/06 NA 1
 
Try this UDF:


Function kiran(a, b)

kiran = ""

If IsDate(a) And IsDate(b) Then
kiran = b - a
Exit Function
End If

If a = "NA" And b = "NA" Then
kiran = "NA"
Exit Function
End If

If a = "NO" And b = "NO" Then
kiran = "voilated"
Exit Function
End If

If IsDate(a) And b = "NO" Then
kiran = Int(Now() - a)
Exit Function
End If

If IsDate(a) And b = "NA" Then
kiran = 1
End If

End Function
 
That's great thanks ...:=(


Gary''s Student said:
Try this UDF:


Function kiran(a, b)

kiran = ""

If IsDate(a) And IsDate(b) Then
kiran = b - a
Exit Function
End If

If a = "NA" And b = "NA" Then
kiran = "NA"
Exit Function
End If

If a = "NO" And b = "NO" Then
kiran = "voilated"
Exit Function
End If

If IsDate(a) And b = "NO" Then
kiran = Int(Now() - a)
Exit Function
End If

If IsDate(a) And b = "NA" Then
kiran = 1
End If

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top