--------------------------------------------
On Fri, 3/3/17, Paul Schreiner <schreiner_p...@att.net> wrote:

 Subject: Re: $$Excel-Macros$$ How to make dynamic formula for value change on 
fix date every month
 To: "excel-macros@googlegroups.com" <excel-macros@googlegroups.com>
 Date: Friday, March 3, 2017, 10:27 PM
 
 First of all, your IF() statement:A nested if statement will evaluate each 
section
 until it finds a true() option.So, in
 the first case:IF(TODAY()<=42750evaluates
 false, that means today is > 42750So
 the second part: IF(AND(TODAY()>=42751  HAS to be true, so
 there's no reason to test it!Your
 IF statement could be simplified to:IF(TODAY()<=42750,0,
 IF(TODAY()<=42781,1.5,
 IF(TODAY()<=42809,3,
 IF(TODAY()<=42840,4.5,
 IF(TODAY()<=42870,6,
 IF(TODAY()<=42901,7.5,
 IF(TODAY()<=42931,9,
 IF(TODAY()<=42962,10.5,
 IF(TODAY()<=42993,12,
 IF(TODAY()<=43023,13.5,
 IF(TODAY()<=43054,15,
 IF(TODAY()<=43084,16.5,
 IF(TODAY()>=43085,18,0)))))))))))))
 But,
 you can simplify it even more.You're
 using the 15th of the month as the "break
 point".So,
 if you were to subtract 15 days, you'd be in the
 "same" month if the day is > 15, and the
 PREVIOUS month if it is before the 15th.Basically,
 by subtracting 15, you're setting the "break
 point" as the first of the month.So,
 if you determine the month number: (MONTH(A5-15)) you could
 say you want 1.5 for each month, or:MONTH(A6-15)
 * 15Now,
 the issue is with the first half of January.subtracting
 15 makes it December of the PREVIOUS year, and therefore
 should be 0 instead of 18.
 so,
 you need to check to see if the offset year is the same as
 the current year:=IF(YEAR(A5-15)
 <> YEAR(TODAY()),0, MONTH(A5-15)*1.5)
 This
 seems match the same as your sample values for rows
 5-9,but
 I'm not sure what you were doing with rows
 12-16Why
 does 16-Mar in row 8 result in 4.5, but 16-Mar in row 13 is
 supposed to be 1.5 ???I'm
 not sure what the rules you're using here.
 as
 for your second query:
 You're
 basically wanting to round off your number to the nearest
 1/2.You
 can accomplish this by first doubling the number and
 removing the decimal portion(extract
 just the integer portion)then
 divide it by 2:=INT(A23*2)/2
 this
 works for your samples.
 hope
 this helps.
 
  Paul-----------------------------------------
 “Do all the
 good you can,
 By all the means you can,
 In all the ways you can,
 In all
 the places you can,
 At all the times you
 can,
 To all the people you can,
 As long as ever you can.” - John Wesley
 -----------------------------------------
 
 
 
    On Friday, March 3,
 2017 12:08 PM, Sunil Kumar Yadav
 <sk.yadav7...@gmail.com> wrote:
   
 
  Dear
 All,
 I have two query for automatically
 update value on one fixed date, have created formula but
 need dynamic formula.
 
 
Formula:IF(TODAY()<=42750,0,IF(AND(TODAY()>=42751,TODAY()<=42781),1.5,IF(AND(TODAY()>=42782,TODAY()<=42809),3,IF(AND(TODAY()>=42810,TODAY()<=42840),4.5,IF(AND(TODAY()>=42841,TODAY()<=42870),6,IF(AND(TODAY()>=42871,TODAY()<=42901),7.5,IF(AND(TODAY()>=42902,TODAY()<=42931),9,IF(AND(TODAY()>=42932,TODAY()<=42962),10.5,IF(AND(TODAY()>=42963,TODAY()<=42993),12,IF(AND(TODAY()>=42994,TODAY()<=43023),13.5,IF(AND(TODAY()>=43024,TODAY()<=43054),15,IF(AND(TODAY()>=43055,TODAY()<=43084),16.5,IF(AND(TODAY()>=43085,TODAY()>=43085),18,0)))))))))))))
 
 Please check excel sheet...Thanks
 in advance for help!
 -- 
 Sky
 
 
 "Good, Better, Best​!Always
 listen to your heart​​​,
 because there lives your parents.​
 
 
 
 
 
 -- 
 
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you
 wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official
 Facebook page of this forum @ https://www.facebook.com/discussexcel
 
  
 
 FORUM RULES
 
  
 
 1) Use concise, accurate thread titles. Poor thread titles,
 like Please Help, Urgent, Need Help, Formula Problem, Code
 Problem, and Need Advice will not get quick attention or may
 not be answered.
 
 2) Don't post a question in the thread of another
 member.
 
 3) Don't post questions regarding breaking or bypassing
 any security measure.
 
 4) Acknowledge the responses you receive, good or bad.
 
 5) Jobs posting is not allowed.
 
 6) Sharing copyrighted material and their links is not
 allowed.
 
  
 
 NOTE  : Don't ever post confidential data in a workbook.
 Forum owners and members are not responsible for any
 loss.
 
 --- 
 
 You received this message because you are subscribed to the
 Google Groups "MS EXCEL AND VBA MACROS" group.
 
 To unsubscribe from this group and stop receiving emails
 from it, send an email to excel-macros+unsubscr...@googlegroups.com.
 
 To post to this group, send email to excel-macros@googlegroups.com.
 
 Visit this group at https://groups.google.com/group/excel-macros.
 
 For more options, visit https://groups.google.com/d/optout.
 
 
  
    
 
 -- 
 
 Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you
 wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official
 Facebook page of this forum @ https://www.facebook.com/discussexcel
 
  
 
 FORUM RULES
 
  
 
 1) Use concise, accurate thread titles. Poor thread titles,
 like Please Help, Urgent, Need Help, Formula Problem, Code
 Problem, and Need Advice will not get quick attention or may
 not be answered.
 
 2) Don't post a question in the thread of another
 member.
 
 3) Don't post questions regarding breaking or bypassing
 any security measure.
 
 4) Acknowledge the responses you receive, good or bad.
 
 5) Jobs posting is not allowed.
 
 6) Sharing copyrighted material and their links is not
 allowed.
 
  
 
 NOTE  : Don't ever post confidential data in a workbook.
 Forum owners and members are not responsible for any
 loss.
 
 --- 
 
 You received this message because you are subscribed to the
 Google Groups "MS EXCEL AND VBA MACROS" group.
 
 To unsubscribe from this group and stop receiving emails
 from it, send an email to excel-macros+unsubscr...@googlegroups.com.
 
 To post to this group, send email to excel-macros@googlegroups.com.
 
 Visit this group at https://groups.google.com/group/excel-macros.
 
 For more options, visit https://groups.google.com/d/optout.
 Vr6Huca impreuna cu ei  iar acestia declarara ca pornirea slugerului Tudor nu

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to