Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How can I increase the value in a cell based on the changing date

At work, we need a "cycle" number that increases by 7 every day. What kind of
formula could a use that would the value in "A1" (Say 5) and increase by 7
every day?

Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 440
Default How can I increase the value in a cell based on the changing date

a1 = 5
A2 = A1+7
drag formula from A2 down
--
Traa Dy Liooar

Jock


"Cray_z77" wrote:

At work, we need a "cycle" number that increases by 7 every day. What kind of
formula could a use that would the value in "A1" (Say 5) and increase by 7
every day?

Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default How can I increase the value in a cell based on the changing date

Private Sub Workbook_Open()
With Worksheets("Sheet1").Range("A1")
If .Offset(0, 1).Value < Date Then
.Value = .Value + 7
.Offset(0, 1) = Date
End If
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


This will put the date in B1 as well.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Cray_z77" wrote in message
...
At work, we need a "cycle" number that increases by 7 every day. What kind
of
formula could a use that would the value in "A1" (Say 5) and increase by 7
every day?

Thank you.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How can I increase the value in a cell based on the changing d

Thank you Bob,

Your reply seems quite suitable but After I post the code into "view code"
section, save the *.xls and return to the spreadsheet, the speadsheet is
still blank.

"Bob Phillips" wrote:

Private Sub Workbook_Open()
With Worksheets("Sheet1").Range("A1")
If .Offset(0, 1).Value < Date Then
.Value = .Value + 7
.Offset(0, 1) = Date
End If
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


This will put the date in B1 as well.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Cray_z77" wrote in message
...
At work, we need a "cycle" number that increases by 7 every day. What kind
of
formula could a use that would the value in "A1" (Say 5) and increase by 7
every day?

Thank you.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default How can I increase the value in a cell based on the changing d

You have to close and open Excel

--
Regards,

Peo Sjoblom

"Cray_z77" wrote in message
...
Thank you Bob,

Your reply seems quite suitable but After I post the code into "view code"
section, save the *.xls and return to the spreadsheet, the speadsheet is
still blank.

"Bob Phillips" wrote:

Private Sub Workbook_Open()
With Worksheets("Sheet1").Range("A1")
If .Offset(0, 1).Value < Date Then
.Value = .Value + 7
.Offset(0, 1) = Date
End If
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


This will put the date in B1 as well.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Cray_z77" wrote in message
...
At work, we need a "cycle" number that increases by 7 every day. What
kind
of
formula could a use that would the value in "A1" (Say 5) and increase
by 7
every day?

Thank you.








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default How can I increase the value in a cell based on the changing date

At work, we need a "cycle" number that increases by 7 every day. What kind
of
formula could a use that would the value in "A1" (Say 5) and increase by 7
every day?


Put your value in A1 as you have proposed. Also put today's date in another
cell (for this example, say B1). Then put this formula in (for this example,
say A2)..

A2: =A1+7*(TODAY()-B1)

For each day that passes, A2 should display the 7 more than the previous
day. I am confused by your highlighting the word "cycle" in your original
posting though... is there some kind of maximum number for which the values
displayed in A2 should "start over"? If so, use this formula instead...

A2: =A1+MOD(7*(TODAY()-B1),X)

where you should replace X with the maximum value before recycling the
count. By the way, the value of X should be a multiple of 7.

Rick

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
Changing background color based on different cell djarcadian Excel Discussion (Misc queries) 3 August 10th 06 10:44 PM
Changing color of single bar based on x-axis date value [email protected] Charts and Charting in Excel 2 August 4th 06 05:17 PM
Formula for changing colour of a cell based on Neumeric VALUE Atul Shah Excel Discussion (Misc queries) 2 March 12th 06 07:44 PM
Changing values in a row based on a cell in the row. Casey Excel Discussion (Misc queries) 2 September 14th 05 03:23 PM
Changing display of decimal value based on the value in the cell K M Excel Worksheet Functions 3 April 3rd 05 06:49 PM


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

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

About Us

"It's about Microsoft Excel"