Consulting

Results 1 to 8 of 8

Thread: Solved: Formula help again

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Solved: Formula help again

    I need to change this formula from this:

    [vba]=IF(D9<="07-01-1996","Colgate",IF(D9<=--"07/01/2000","Hills",""))[/vba]
    to make the second if:

    If D9, >07-01-1996 and <= 07/01/2000, etc.
    Peace of mind is found in some of the strangest places.

  2. #2
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    [VBA]Sub Macro1()
    '
    ' Macro1 Macro
    '

    '
    ActiveCell.FormulaR1C1 = _
    "=IF(R[-2]C[-1]<=""07-01-1996"",""Colgate"",IF(R[-2]C[-1]<=--""07/01/2000"",""Hills"",""""))"
    Range("E12").Select
    End Sub
    [/VBA]

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    looks like the same thing. can you explain?
    Peace of mind is found in some of the strangest places.

  4. #4
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    I misread your initial post. Apologies.

    So you want anything earlier than 7/1/96 to be colgate. anything b/w that and 2000 to be hills and anything after that to be blank?

  5. #5
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    If that's the case, you can use this formula

    =IF(D9<=DATE(1996,7,1),"Colgate",IF(AND(D9>DATE(1996,7,1),D9<=DATE(2000,7,1 )),"Hills",""))

  6. #6
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    so i want anything that is before 7/1/1996 = Colgate
    between 7/2/1996 up to and = to 7/1/2000 = Hills and
    everything else be blank.
    Peace of mind is found in some of the strangest places.

  7. #7
    VBAX Mentor
    Joined
    Oct 2007
    Posts
    372
    Location
    i had 2 back to back posts. let me know if the 2nd doesn't solve.

  8. #8
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    thats it (the second one). thanks
    Peace of mind is found in some of the strangest places.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •