Semi-month number

MAP

Active Member
Joined
Mar 22, 2007
Messages
312
Office Version
  1. 2007
Platform
  1. Windows
I am an Excel novice still using the simple excel 2003.

While I know how to get the week number, I want to now learn how to get the "semi-month" number using a formula.

For example A1 has the date, B1 would have formula to calculate the semi-monthly number
01 Jan = 01
15 Jan = 01
16 Jan = 02
13 Feb = 03
28 Feb = 04
10 Mar =05
25 Mar =06
07 May =09
17 May =10
16 July =14
31 July =14
 
My suggestion will be:
Excel Formula:
=(MONTH(A1)*2)+LOOKUP(DAY(A1)-(DAY(EOMONTH(A1,0))/2),{-16,0},{-1\0})
Thank you, Flashbond... but since I am using an old, old, old version of Excel, the EOMONTH function is not available.
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This may work:
Excel Formula:
=(MONTH(A1)*2)+LOOKUP(DAY(A1)-(DAY(DATE(YEAR(A1),MONTH(A1)+1,0))/2),{-16,0},{-1,0})
 
Upvote 0
Mr. Rick Rothstein, I thank you again for your assistance. The initial formula you provided has worked PERFECTLY (the revised one failed with the 15 Feb date). The 01 Feb to 15 Feb is semi-month number 3, and 16 Feb to end of Feb is semi-month number 4.
You say my first formula worked "perfectly", so I am guessing it "answered" your question; however, you did not mark my message with that formula as the "Answer", instead you marked Flashbond's post telling me that that formula might not correctly handle February 15th as the "Answer". I'm guessing that was a mistake which you might want to correct.
 
Upvote 0
You say my first formula worked "perfectly", so I am guessing it "answered" your question; however, you did not mark my message with that formula as the "Answer", instead you marked Flashbond's post telling me that that formula might not correctly handle February 15th as the "Answer". I'm guessing that was a mistake which you might want to correct.
I offer my apologies. I intended to click the check mark to express my satisfaction with Mr. Rothstein's initial formula [ =2*MONTH(B1)-(DAY(B1)<16) ] that worked perfectly. I am not sure what I may have inadvertently done, but I offer my humble appreciation to Rick Rothstein for his solution that solved my problem.
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,824
Members
449,470
Latest member
Subhash Chand

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