메인 컨텐츠로 가기

Excel에서 두 날짜 사이의 주말 / 주중 수를 계산하는 방법은 무엇입니까?

때로는 두 날짜 사이의 특정 평일 수를 알아야합니다. 예를 들어 두 개의 날짜가 있습니다. 시작 날짜는 1 년 1 월 2014 일이고 종료 날짜는 2 년 15 월 2014 일입니다. 이제이 기간 동안 일요일, 월요일 또는 화요일 등이 몇 번 발생하는지 알고 싶습니다. 이것은 우리에게는 다소 어려울 수 있지만 여기서는 효과적인 방법에 대해 이야기 할 수 있습니다.


공식을 사용하여 두 날짜 사이의 특정 주중 / 주말 수를 계산합니다.

다음과 같은 두 개의 날짜가 있다고 가정하고 그 사이에 몇 개의 일요일이 있는지 계산해야합니다. 빈 셀을 선택하고 아래 수식을 입력 한 다음 엔터 버튼 키. 이제 두 날짜 사이의 일요일 수를 알 수 있습니다. 스크린 샷보기 :

=INT((WEEKDAY($C$2- 1)-$C$2+$C3)/7)

배송 시 요청 사항:

(1) 위의 공식에서 C2는 시작일이고 C3은 종료일을 나타냅니다.

(2) 위 공식에서 1 일요일을 의미합니다. 그리고 숫자 1을 1과 7 사이의 다른 숫자로 바꿀 수 있습니다.1은 일요일, 2는 월요일, 3은 화요일, 4는 수요일, 5는 목요일, 6은 금요일, 7은 토요일입니다.)


수식을 사용하여 월의 특정 요일 수를 계산합니다.

때로는 주어진 달의 특정 요일의 총 수를 계산해야 할 수도 있습니다. 2020 년 XNUMX 월에 수요일의 총 수를 계산합니다. 여기에서는 특정 요일의 총 수를 계산하는 공식을 소개합니다. 쉽게 달.

빈 셀을 선택하고 공식 아래에 입력 한 다음 Enter 키를 눌러 계산 결과를 얻습니다.

=INT((WEEKDAY(DATE(G2,G3,1)- G4)-DATE(G2,G3,1)+EOMONTH(DATE(G2,G3,1),0))/7)

노트:

(1) 위의 공식에서 G2는 지정된 연도, G3는 지정된 월, G4는 지정된 요일입니다.

(2)이 공식은 요일을 나타내는 정수를 할당합니다. 1은 일요일, 2는 월요일, 3은 화요일, 4는 수요일, 5는 목요일, 6은 금요일, 7은 토요일입니다.


사용자 정의 함수를 사용하여 특정 월의 특정 주중 / 주말 수를 계산합니다.

사용자 정의 함수를 생성하여 위의 공식 외에 주어진 연도 및 월의 특정 평일 수를 계산할 수도 있습니다.

1. 누르고 ALT + F11 키가 열립니다. Microsoft Visual Basic for Applications 창.

2. 딸깍 하는 소리 끼워 넣다 > 모듈을 클릭하고 다음 코드를 모듈 창.

Public Function TotalDays(pYear As Integer, pMonth As Integer, pDay As Integer)
'Update 20140210
Dim xindex As Integer
Dim endDate As Integer
endDate = Day(DateSerial(pYear, pMonth + 1, 0))
For xindex = 1 To endDate
    If Weekday(DateSerial(pYear, pMonth, xindex)) = pDay Then
        TotalDays = TotalDays + 1
    End If
Next
End Function

3. 이 코드를 저장하고 워크 시트로 돌아간 다음 빈 셀에이 수식을 입력합니다. = TotalDays (년, 월, 1) . 이 예에서는 2020 년 XNUMX 월에 일요일이 몇 개 있는지 계산할 것이므로이 공식을 아래 공식 중 하나로 적용 할 수 있습니다., 다음을 누릅니다. 엔터 버튼 키, 한 번에 몇 개의 일요일을 얻을 수 있습니다. 스크린 샷 참조 :

= TotalDays (C2, C3, C4)

= TotalDays (2020,6,1)

 

배송 시 요청 사항: 이 공식은 정수를 사용하여 요일을 나타냅니다. 1은 일요일, 2는 월요일, 3은 화요일, 4는 수요일, 5는 목요일, 6은 금요일, 7은 토요일입니다..


Excel 용 Kutools를 사용하여 두 날짜 사이의 모든 주말 / 주중 / 특정 요일의 수를 계산합니다.

실제로 Excel 용 Kutools를 적용 할 수 있습니다. 두 날짜 사이의 휴무일 수 공식, 두 날짜 사이의 근무일 수 공식 및 특정 요일 수를 계산 수식을 사용하여 Excel의 날짜 범위에서 모든 주말, 주말 또는 특정 요일의 수를 빠르게 계산합니다.

Excel 용 Kutools - 300개 이상의 Excel용 필수 도구가 포함되어 있습니다. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 지금 다운로드!

1. 계산 결과를 배치 할 빈 셀을 선택하고 Kutools> Formula Helper> Formula Helper를 클릭하여이 기능을 활성화합니다.

그런 다음 계산 유형에 따라 진행하십시오.

A. Excel에서 두 날짜 사이의 주말 (토요일과 일요일) 수 계산

수식 도우미 대화 상자에서 다음과 같이하십시오.
(1) 선택 통계적인 인사말 공식 유형 드롭 다운 목록;
(2) 클릭하여 선택 두 날짜 사이의 휴무일 수 FBI 증오 범죄 보고서 공식 선택 리스트 박스;
(3) 시작 날짜를 시작 날짜 상자 (날짜 셀을 참조 할 수도 있음);
(4) 종료 날짜를 종료 날짜 상자 (날짜 셀을 참조 할 수도 있음);
(5) OK 버튼을 클릭합니다.

이제 선택한 셀의 모든 토요일과 일요일의 총 수를 반환합니다.

Excel 용 Kutools - 300개 이상의 필수 도구로 Excel을 강화하세요. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 이제 그것을 잡아

B. Excel에서 두 날짜 사이의 평일 수 (토요일과 일요일 제외) 계산

수식 도우미 대화 상자에서 다음과 같이하십시오.
(1) 선택 통계적인 인사말 공식 유형 드롭 다운 목록;
(2) 클릭하여 선택 두 날짜 사이의 근무일 수 FBI 증오 범죄 보고서 공식 선택 리스트 박스;
(3) 시작 날짜를 시작 날짜 상자 (날짜 셀을 참조 할 수도 있음);
(4) 종료 날짜를 종료 날짜 상자 (날짜 셀을 참조 할 수도 있음);
(5) OK 버튼을 클릭합니다.

그런 다음 선택한 셀의 총 평일 수 (토요일과 일요일 제외)를 반환합니다.

Excel 용 Kutools - 300개 이상의 필수 도구로 Excel을 강화하세요. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 이제 그것을 잡아

C. Excel에서 두 날짜 사이의 특정 요일 (월요일, 토요일, 일요일 등) 수 계산

수식 도우미 대화 상자에서 다음과 같이하십시오.
(1) 선택 통계적인 인사말 공식 유형 드롭 다운 목록;
(2) 클릭하여 선택 특정 요일 수를 계산 FBI 증오 범죄 보고서 공식 선택 리스트 박스;
(3) 시작 날짜를 시작 날짜 상자 (날짜 셀을 참조 할 수도 있음);
(4) 종료 날짜를 종료 날짜 상자 (날짜 셀을 참조 할 수도 있음);
(5) 정수로 특정 요일을 지정합니다 (1은 일요일, 2-5는 월요일부터 금요일, 7은 토요일을 나타냅니다).
(6) OK 버튼을 클릭합니다.

그런 다음 주어진 날짜 범위에서 지정된 요일의 총 수를 반환합니다.

Excel 용 Kutools - 300개 이상의 필수 도구로 Excel을 강화하세요. 신용카드 없이 모든 기능을 갖춘 30일 무료 평가판을 즐겨보세요! 이제 그것을 잡아


관련 기사 :

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Let's say you want to calculate the 3rd Thursday of the month and assume the date of the first of the month is in cell A1. We need to first work out the date of the Thursday in the week of A1. Because Thursday is the 5th day of the week, we use: =A1-WEEKDAY(A1)+5 Then if this Thursday falls before A1, we need to add 7 using [b]((A1-WEEKDAY(A1)+5)
This comment was minimized by the moderator on the site
What about a formula that returns the actual date of the first Wed of each month, Or the 2nd and 3rd tuesday of each month? Or every 3rd tuesday? I want to be able to put in my own start and end dates and then get the actual DATES (not the count) returned to me. Any ideas?
This comment was minimized by the moderator on the site
hi sir, i want to calculate no. of weeks in excel between two dates, but Dose not see right weeks as per date for example: I enterd the date 01/01/2016 ( Friday) and second date 14/01/2016( thursday) no of weeks showing = 2 weeks. but i want to show exact 2 weeks completed 15/01/2016 other wise show previse no fo weeks.
This comment was minimized by the moderator on the site
Let the start and end dates be in cells A1 and A2, respectively. This should work: =INT((A2-A1)/7)
This comment was minimized by the moderator on the site
Is it possible to have the start date set to "=today()" and the end date, for example, the 22nd of the current cycle. As the date returns to the 23rd, refresh the formula to the following 22nd?
This comment was minimized by the moderator on the site
Assuming cycle refers to month, this should work for the end date: DATE(YEAR(TODAY()),MONTH(TODAY())+IF(DAY(TODAY())>22,1,0),22)
This comment was minimized by the moderator on the site
Why are my comments not published completely????
This comment was minimized by the moderator on the site
[quote]Why are my comments not published completely????By Mohamed[/quote] Sorry, please try to send me the formula to jaychivo#extendoffice.com. Please replace @ with #. And i will help you post it. May be there are some characters which have been blocked. :-)
This comment was minimized by the moderator on the site
Hi Jaco, You may achieve this for someone who works Mondays (2), Wednesdays (4) and Fridays (6) as follows: (1) Call the year's start and end dates [quote]StartDate[/quote] and [quote]EndDate[/quote], respectively. (2) List all the public holidays in South Africa (this could span more than one year) in a range and call it [quote]PublicHolidays[/quote] (3) To calculate the total number of days worked enter the following array formula: [quote]=INT((WEEKDAY(StartDate-2)-StartDate+EndDate )/7)+INT((WEEKDAY(StartDate-4)-StartDate+EndDate )/7)+INT((WEEKDAY(StartDate-6)-StartDate+EndDate )/7)-SUM(IF((PublicHolidays>=StartDate)*(PublicHolidays
This comment was minimized by the moderator on the site
Sorry the formula above is not complete: It should be: =INT((WEEKDAY(StartDate-2)-StartDate+EndDate)/7)+INT((WEEKDAY(StartDate-4)-StartDate+EndDate)/7)+INT((WEEKDAY(StartDate-6)-StartDate+EndDate)/7)-SUM(IF((PublicHolidays>=StartDate)*(PublicHolidays
This comment was minimized by the moderator on the site
I don't know what happened to my formula and the rest of my message above. The formula should be: =INT((WEEKDAY(StartDate-2)-StartDate+EndDate )/7)+INT((WEEKDAY(StartDate-4)-StartDate+EndDate)/7)+INT((WEEKDAY(StartDate-6)-StartDate+EndDate )/7)-SUM(IF((PublicHolidays>=StartDate)*(PublicHolidays
This comment was minimized by the moderator on the site
Hi, I am from South Africa and I need advice. I have two workers at work who works different days. Now I want to type in a formula in excel to count how many days a year she work (that I can do), but the trick comes in when I want to type in a formula which allows me to deduct if one of her working days is a public holiday for example she works Monday, Wednesday and Friday. That means she works 156 days per year, but I want excel to deduct the holidays if it is on one of her working days. Can someone please assist me?
This comment was minimized by the moderator on the site
Does not work properly. You need to consider what day you're starting from and ending with!
This comment was minimized by the moderator on the site
Hi Laura, Could you please elaborate?
This comment was minimized by the moderator on the site
Thank you for this. Question, how do I add another day like "Wednesday or 4" to the Monday? Basically I want it to calculate both the total of Mondays and Wednesdays between the two dates. How do I write this formula? Thanks again
This comment was minimized by the moderator on the site
To help future seekers. Use this formula for calculating days between two dates: =NETWORKDAYS.INTL( start_date, end_date, [weekend], [holidays] ) =NETWORKDAYS.INTL(A3,A4,"00000011",C3:C8) - 0=include day 1=exclude day
This comment was minimized by the moderator on the site
THANK YOU VERY MUCH!!! This is perfect! This function exactly does the task!
This comment was minimized by the moderator on the site
Try =INT((WEEKDAY($B$1-2)-$B$1+$B2)/7)+INT((WEEKDAY($B$1-4)-$B$1+$B2)/7)
This comment was minimized by the moderator on the site
Thank You. This is so useful.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations