Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula to VBA


Hello there,

Can Some One please Help in Converting the following Formula to
Function?

C2 Contains "dd-mmm-yyyy hh:mm:ss"
Time A5 Contains 02:30:00
Time A21 Contains 17:30:00

=IF(AND(WEEKDAY(C2,2)5,IF(WEEKDAY(C2,2)<6,IF(AND( TM(C2)=Time!$A$5,TM(C2)<Time!$A$21),Time!$A$21,TM (C2)),IF(WEEKDAY(C2,2)<7,IF(TM(C2)=Time!$A$5,Time !$A$21,TM(C2)),Time!$A$21))=Time!$A$21),INT(C2+2), INT(C2))

Thanks,
Baap

--
Baap
-----------------------------------------------------------------------
Baapi's Profile: http://www.excelforum.com/member.php...fo&userid=2733
View this thread: http://www.excelforum.com/showthread.php?threadid=47793

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Formula to VBA

Couple of problems

This part

AND(WEEKDAY(C2,2)5,IF(WEEKDAY(C2,2)<6

can never be true,

and what is TM

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Baapi" wrote in
message ...

Hello there,

Can Some One please Help in Converting the following Formula to a
Function?

C2 Contains "dd-mmm-yyyy hh:mm:ss"
Time A5 Contains 02:30:00
Time A21 Contains 17:30:00


=IF(AND(WEEKDAY(C2,2)5,IF(WEEKDAY(C2,2)<6,IF(AND( TM(C2)=Time!$A$5,TM(C2)<T
ime!$A$21),Time!$A$21,TM(C2)),IF(WEEKDAY(C2,2)<7,I F(TM(C2)=Time!$A$5,Time!$
A$21,TM(C2)),Time!$A$21))=Time!$A$21),INT(C2+2),IN T(C2))

Thanks,
Baapi


--
Baapi
------------------------------------------------------------------------
Baapi's Profile:

http://www.excelforum.com/member.php...o&userid=27333
View this thread: http://www.excelforum.com/showthread...hreadid=477930



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula to VBA


Bob,

AND Function used is not between WEEKDAY(C2,2)5 an
IF(WEEKDAY(C2,2)<6

But is between " WEEKDAY(C2,2)5 " and

IF(WEEKDAY(C2,2)<6,IF(AND(TM(C2)=Time!$A$5,TM(C2) <Time!$A$21),Time!$A$21,TM(C2)),IF(WEEKDAY(C2,2)<7 ,IF(TM(C2)=Time!$A$5,Time!$A$21,TM(C2)),Time!$A$2 1))=Time!$A$2
"

and TM is a Add-In function that works a
"TIME(HOUR()<MINUTE()<SECOND())"

This should help!!

--
Baap
-----------------------------------------------------------------------
Baapi's Profile: http://www.excelforum.com/member.php...fo&userid=2733
View this thread: http://www.excelforum.com/showthread.php?threadid=47793

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
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 06:08 PM.

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

About Us

"It's about Microsoft Excel"