Add 30 days to if criteria
Closed
Anonymous User
-
Aug 10, 2009 at 03:23 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Aug 10, 2009 at 09:21 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Aug 10, 2009 at 09:21 PM
Related:
- Add 30 days to if criteria
- 2007 microsoft office add-in microsoft save as pdf or xps - Download - Other
- Skype last seen days ago - Guide
- *#30# android code - Guide
- Add 90 days to a date - Guide
- How to add songs to sound picker - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Aug 10, 2009 at 09:21 PM
Aug 10, 2009 at 09:21 PM
I suppose A1 is where you enter invoice or not. B1 is date. You cannot change B1 otheriwse it will elad to ciruclar reference. in another empty cell in the same row the following formula
=IF(A1="invoice",IF(MONTH(B1)=12,DATE(YEAR(B1)+1,1,DAY(B1)),DATE(YEAR(B1),MONTH(B1)+1,DAY(B1))),"")
if you ant to change the date in B1 itself you need a small event code
right click the sheet tab and click view code and copy paste this code
wherever you enter "invoice in column A the next entry in column B will advance by one month. do a few tests. in an empty workbook
=IF(A1="invoice",IF(MONTH(B1)=12,DATE(YEAR(B1)+1,1,DAY(B1)),DATE(YEAR(B1),MONTH(B1)+1,DAY(B1))),"")
if you ant to change the date in B1 itself you need a small event code
right click the sheet tab and click view code and copy paste this code
Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range Set rng = Target.Offset(0, 1) If Target.Column <> 1 Then Exit Sub If Target = "" Then Exit Sub If Target = "invoice" Then If Month(Target.Offset(0, 1)) = 12 Then rng = 1 & "/" & Day(rng) & "/" & Year(rng) + 1 Else rng = Month(rng) + 1 & "/" & Day(rng) & "/" & Year(rng) End If End If End Sub
wherever you enter "invoice in column A the next entry in column B will advance by one month. do a few tests. in an empty workbook