메인 컨텐츠로 가기

Excel에서 취소 선 셀을 계산 / 합산하는 방법은 무엇입니까?

Excel에서는 데이터를보다 정확하게 분석 할 수 있도록 셀 값이 쓸모 없거나 유효하지 않음을 나타내는 일부 셀에 대해 항상 취소 선 서식을 지정합니다. 이 기사에서는 Excel에서 이러한 취소 선 셀을 사용하여 범위에서 몇 가지 계산을 수행하는 방법에 대해 설명합니다.

Excel에서 취소 선 셀 계산

Excel에서 취소 선없이 셀 계산

합계는 Excel에서 취소 선 셀을 제외합니다.


화살표 블루 오른쪽 거품 Excel에서 취소 선 셀 계산

범위에서 취소 선 형식의 셀 수를 알고 싶다면 사용자 정의 함수를 만들 수 있습니다. 다음 단계를 따르세요.

1. 누르고 ALT + F11 키를 눌러 Microsoft Visual Basic for Applications 창.

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

VBA 코드 : 취소 선 셀 계산

Public Function CountStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
    If pRng.Font.Strikethrough Then
        xOut = xOut + 1
    End If
Next
CountStrike = xOut
End Function

3. 그런 다음이 코드를 저장하고 닫은 다음 워크 시트로 돌아간 다음이 수식을 입력합니다. = CountStrike (A2 : B14) 빈 셀에, 스크린 샷 참조 :

doc-카운트-스트라이크-1

4. 그런 다음 엔터 버튼 모든 취소 선 셀이 계산되었습니다. 스크린 샷보기 :

doc-카운트-스트라이크-1


화살표 블루 오른쪽 거품 Excel에서 취소 선없이 셀 계산

그러나 때로는 취소 선 셀을 제외한 일반 셀의 수만 세고 싶을 수도 있습니다. 다음 코드가 도움이 될 수 있습니다.

1. 누르고 ALT + F11 키를 눌러 Microsoft Visual Basic for Applications 창.

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

VBA 코드 : 취소 선없는 셀 계산

Public Function CountNoStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
    If Not pRng.Font.Strikethrough Then
        xOut = xOut + 1
    End If
Next
CountNoStrike = xOut
End Function

3. 그런 다음이 코드를 저장하고 닫고 워크 시트로 돌아가이 수식을 입력합니다. = countnostrike (A2 : B14) 빈 셀에 넣고 엔터 버튼 키를 누르면 필요한 결과를 얻을 수 있습니다.

doc-카운트-스트라이크-1

주의 사항: 위 공식에서 A2 : B14 수식을 적용 할 범위입니다.


화살표 블루 오른쪽 거품 합계는 Excel에서 취소 선 셀을 제외합니다.

취소 선 셀은 사용되지 않기 때문에 여기서는 취소 선 번호가없는 일반 숫자 만 합산하고 싶습니다. 이 작업을 해결하려면 사용자 정의 함수도 필요합니다.

1. 누르고 ALT + F11 키를 눌러 Microsoft Visual Basic for Applications 창.

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

VBA 코드 : 합계는 취소 선 셀을 제외합니다.

Public Function ExcStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
    If Not pRng.Font.Strikethrough Then
        xOut = xOut + pRng.Value
    End If
Next
ExcStrike = xOut
End Function

3. 그런 다음이 코드를 저장하고 닫고 워크 시트로 돌아가이 수식을 입력합니다. = excstrike (B2 : B14) 빈 셀에 넣고 엔터 버튼 키, 취소 선 셀없이 모든 숫자의 합계를 얻을 수 있습니다. 스크린 샷보기 :

doc-카운트-스트라이크-1

주의 사항: 위 공식에서 B2 : B14 취소 선 형식없이 셀을 더할 범위입니다.


관련 기사 :

Excel의 셀 범위에서 굵은 숫자를 합산 / 계산하는 방법은 무엇입니까?

Excel에서 배경색을 기준으로 셀 수를 계산하고 합계하는 방법은 무엇입니까?

Excel의 글꼴 색상을 기반으로 셀을 계산 / 합산하는 방법은 무엇입니까?

최고의 사무 생산성 도구

🤖 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 (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I want to ignore the cell from count where both type of text strike and non strike available by VBA
This comment was minimized by the moderator on the site
Great! I found a little bug here. The result doesn't actualize by itself. When I do changes on the sheet, the number doesn't changes. How can I fix it? Thanks
This comment was minimized by the moderator on the site
Hi. Great code for ignoring strikethrough text whilst summing. But, is it possible to filter the data and get a subtotal which still sums without the strike through text? Thanks
This comment was minimized by the moderator on the site
This seems to round to whole numbers, and does not take into account the decimal places. For example, 1.35 + 1.00 would equal 2 instead of 2.35, but 1.50 + 1 would equal 3 instead of 2.50. How can you fix the code to add accurately?
This comment was minimized by the moderator on the site
[quote]This seems to round to whole numbers, and does not take into account the decimal places. For example, 1.35 + 1.00 would equal 2 instead of 2.35, but 1.50 + 1 would equal 3 instead of 2.50. How can you fix the code to add accurately?By Ari[/quote] ARI, just change the two words "Long" to "Double" in the formula. Here is the same formula above, with the correct Data Types to allow for values with decimal points: Public Function ExcStrike(pWorkRng As Range) As Double 'Update 20161107_IITCSglobal.com Application.Volatile Dim pRng As Range Dim xOut As Double xOut = 0 For Each pRng In pWorkRng If Not pRng.Font.Strikethrough Then xOut = xOut + pRng.Value End If Next ExcStrike = xOut End Function
This comment was minimized by the moderator on the site
Thank you very much for this information, it's extremely helpful, However, I'm having an issue using the VBA code: Sum exclude strikethrough cells.

It does not exclude the strikethrough cells in my table unless I manually perform a strikethrough then double click the cell for the code to work.

I'm using a table with a conditional format to shade and strikethrough the entire row when (Table Header called Sold) Column "W" cell contains a "Yes", then that row will have a strikethrough and grey color. The worksheet table is "InventoryItems" and is configured to calculated automatically, but the code is not being triggered to exclude the dollar amount when the cell contains the strikethrough. Could you advise what I might be doing wrong?
Thank you for your time and help.

There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations