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
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
My first thought is a Lookup.
With B4, I named the Lookup information.

T202302.xlsm
AB
1
21-Jan-231
331-Jul-2314
45-May-239
5
1a
Cell Formulas
RangeFormula
B2:B3B2=LOOKUP(A2,$D$2:$E$25)
B4B4=LOOKUP(A4,aL)
 
Last edited:
Upvote 0
Give this formula a try...

=2*MONTH(B1)-(DAY(B1)<16)

By the way, your original message says you are using XL2003 but your profile says you are using XL2007.
 
Last edited:
Upvote 0
Solution
Hi! Februray 15 may not play well with this formula.
I never heard of a semi-month before so I thought it used the 15th/16th as the dividing line. I'm guessing that is not correct. From your comment, I'm guessing it splits the month in half, rounding fractions down. If that is correct, then February is the only month I would have wrong. This modified formula should work then...

=2*MONTH(B4)-(DAY(B4)<16)+(B4=DATE(YEAR(B8),2,15))
 
Upvote 0
My suggestion will be:
Excel Formula:
=(MONTH(A1)*2)+LOOKUP(DAY(A1)-(DAY(EOMONTH(A1,0))/2),{-16,0},{-1\0})
 
Upvote 0
I never heard of a semi-month before so I thought it used the 15th/16th as the dividing line. I'm guessing that is not correct. From your comment, I'm guessing it splits the month in half, rounding fractions down. If that is correct, then February is the only month I would have wrong. This modified formula should work then...

=2*MONTH(B4)-(DAY(B4)<16)+(B4=DATE(YEAR(B8),2,15))
Sorry for my prejudgement. I just thought like that. OP doesn't provide detailed information about this.

Fixing regional setting in my formula:
Excel Formula:
=(MONTH(A1)*2)+LOOKUP(DAY(A1)-(DAY(EOMONTH(A1,0))/2),{-16,0},{-1,0})
 
Last edited by a moderator:
Upvote 0
Hi! Februray 15 may not play well with this formula.

My first thought is a Lookup.
With B4, I named the Lookup information.

T202302.xlsm
AB
1
21-Jan-231
331-Jul-2314
45-May-239
5
1a
Cell Formulas
RangeFormula
B2:B3B2=LOOKUP(A2,$D$2:$E$25)
B4B4=LOOKUP(A4,aL)
Dave Patton, I thank you for your suggestion. Of course, I was hoping to have things "automated" by Excel with a formula so I would not need to set up a list and use a LOOKUP function.
 
Upvote 0
I was hoping to have things "automated" by Excel with a formula

See Rick Rothstein's solution post #3.
 
Upvote 0
Give this formula a try...

=2*MONTH(B1)-(DAY(B1)<16)

By the way, your original message says you are using XL2003 but your profile says you are using XL2007.
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.
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,914
Members
449,054
Latest member
luca142

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