Weeknum vs Month

chandrashekar

Well-known Member
Joined
Jul 15, 2005
Messages
529
Office Version
  1. 365
Platform
  1. Windows
Hello Team,

Could you please help me in formula(attached). Where if week number continuous to next month I need to get previous month in Column D(Formula generate)
1715583711199.png


Regards,
Chandrashekar B
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
In cell D2 enter following:
Excel Formula:
= DATE(YEAR(A2), MONTH(A2)-1, 1)

1715588824954.png
 
Upvote 0
Hello,

Can you please check formula again as requirement is different. Month should change as per week number.

Sometime week number will same for this month and next month.

1715592728643.png


Regards,
Chandrashekar B
 
Upvote 0
Try adding a check for the week number from @PeteWright's solution.
Excel Formula:
=IF(B2=B1,C1,DATE(YEAR(A2), MONTH(A2)-1, 1))
 
Upvote 0
Hello,

Sorry it is not working expected result in D column.

Regards,
Chandrashekar B
 
Upvote 0
How about
Excel Formula:
=IF(C2=C1,D1,EOMONTH(A2,-1)+1)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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