Incrementing numbers

New Member
Good evening Gurus, ray:

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...

Thanks a lot!!

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

tactps

Well-known Member
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)

New Member
Thanks!! And thanks for answering so promptly. I'm going to give that a whirl and wait until Friday to check out the result. I guess I should give up my computer privileges eh??!!

New Member
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
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!)

Replies
0
Views
348
Replies
8
Views
289
Replies
5
Views
325
Replies
11
Views
885
Replies
7
Views
383

1,182,026
Messages
5,933,336
Members
436,888
Latest member
Kantonides

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?

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

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