determine which formula to use

  • Thread starter jln via OfficeKB.com
  • Start date
J

jln via OfficeKB.com

OK what i have is a dates in column D. in column G i have formuals
If the date in column D is = first day of the month then use =F41*30
if date in column D is greater then first day of month then use =ROUND(F44*
(30-(DAY(D44-1))),2)

Help i need to add code that will do is to a macro that im running.
 
T

Tom Ogilvy

In G1 as an example:
=if(day(d1)=1,F41*30,ROUND(F44*(30-(DAY(D44-1))),2)

I don't know if your 41 and 44 are meant to be absolute or relative, but I
am sure you can work that out.
 
J

jln via OfficeKB.com

i just wanted to check with you on day(d1) my date looks like 8/1/2006 will
this work with what you posted?
 
T

Tom Ogilvy

I would expect it to. it does for me. It seems odd that you would wonder.
Perhaps there is something you are not telling use. Is this stored as a
string (instead of a date) in m/d/yyyy format and your regional settings
expect d/m/yyyy?


By the way, you are already using the DAY function in your second formula to
determine the day of the month.
 
J

jln via OfficeKB.com

Tom hopefuly last questions on this f41 and f44 are relative. How do i figure
for that? 2nd will this work to replace this line in my code?
Range("F41:F" & lRow).FormulaR1C1 = "=RC[-3]*RC[-1]/360"
 

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

Top