Incrementing numbers

STRONGSAD

New Member
Joined
Jan 19, 2005
Messages
15
Good evening Gurus, :pray:

I would like to know if it is possible to increment a number only on a Friday.
Or perhaps every Wednesday and Saturday.
Currently I have A1=TODAY and B1=WEEKDAY(A1)
But then I'm stuck. What I need for it to do is this Friday I want it to be 533, but to increment every Friday by one. Am I on the right track? My IF statement will work on one Friday but I can't get it to keep incrementing every Friday... :rolleyes:

Thanks a lot!!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
Welcome.

Is this a formula you want or VBA?

If a formula:
Assuem B1 contains the date, and B2 contains the number you want to increment:
=if(weekday(B1)=6,B2+1,B2)
 

STRONGSAD

New Member
Joined
Jan 19, 2005
Messages
15
Thanks!! And thanks for answering so promptly. I'm going to give that a whirl and wait until Friday to check out the result. :oops: I guess I should give up my computer privileges eh??!!
:LOL:
 

STRONGSAD

New Member
Joined
Jan 19, 2005
Messages
15
Sorry to bother you again, I checked my spreadsheet and it is not incrementing my number every Friday...
This is what I have so far...


E9=TODAY()
T6=IF(WEEKDAY(E9)=6,T7+1,T7)
T7=555
E7= $T6

Can you see what I am doing wrong??
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

Unless you're manually changing T7 each week, T6 will only be T7+1.

You may want to try this approach that checks the system date; if it's Friday it increments T6's value by 1 automatically when the workbook is opened.
Code:
Private Sub Workbook_Open()
    '   If Friday then increment T6 by one
    If Weekday(Date) = 6 Then [T6].Value = [T6].Value + 1
End Sub
Hit ALT+F11 to open the VB Editor and paste the code in the ThisWorkbook module.

Note that if you open it multiple times on a Friday it will increment multiple times, so some additional coding would be needed to account for that.

Hope that helps,

Smitty

(Heya tact!)
 

Forum statistics

Threads
1,148,216
Messages
5,745,436
Members
423,951
Latest member
peggrif

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top