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

Thanks a lot!!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
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)
 
Upvote 0
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??!!
:laugh:
 
Upvote 0
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??
 
Upvote 0
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!)
 
Upvote 0

Forum statistics

Threads
1,222,180
Messages
6,164,419
Members
451,893
Latest member
csmithbuffalo

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
Back
Top