전체 글 45

Power Query 같은 값 순번 만들기 | 그룹별 차수 자동 생성 방법

Power Query를 활용해 같은 값 기준으로 순번을 자동 생성하는 방법을 정리했습니다. 데이터를 정리하다 보면 같은 값이 반복되는 경우가 많습니다. 이때 각 값별로 1차, 2차, 3차와 같은 순번을 만들어야 하는 상황이 자주 발생합니다. 이 작업은 단순 계산으로는 처리하기 어렵지만 Power Query에서는 그룹 기능을 활용하면 쉽게 해결할 수 있습니다. 먼저 전체 데이터의 순서를 유지하기 위해 Index를 추가한 뒤, 특정 컬럼 기준으로 그룹화를 진행합니다. 이후 각 그룹 내부에서 다시 Index를 생성하면 그룹별 순번이 만들어집니다. 그 다음 데이터를 다시 펼치고 원래 순서대로 정렬하면 원하는 형태의 결과를 얻을 수 있습니다. 이 구조를 만들어두면 데이터가 추가되더라도 새로고침만으로 순번이 자동으..

Power Query 카드 월별 집계 자동화 | 없는 월 표시 + 총계 오류 해결 방법

Power Query를 활용해 엑셀 카드 사용 데이터를 월별로 자동 집계하고, 없는 월까지 표시하며 총계 오류를 해결하는 방법을 정리했습니다. 엑셀에서 월별 집계를 만들다 보면 데이터가 없는 월이 아예 표시되지 않거나, 빈 값 또는 특수 문자(-)로 인해 총계 계산 시 오류가 발생하는 문제가 자주 발생합니다. 또한 계정이나 계좌 기준으로 데이터를 정리하는 과정에서 구조가 깨지는 경우도 많습니다. 이러한 문제는 Power Query를 활용하면 한 번에 해결할 수 있습니다. 핵심은 단순 집계가 아니라 데이터가 없어도 월을 유지하고, 오류 없이 총계를 계산할 수 있는 구조를 만드는 것입니다. 먼저 날짜 데이터를 기준으로 월 정보를 생성한 뒤, 계정과 계좌 기준으로 데이터를 그룹화하여 월별 합계를 계산합니다. ..

Power Query 출퇴근 데이터 정리 방법 | 근태 출근·퇴근 시간 자동 계산

Power Query를 활용해 엑셀 출퇴근 데이터를 자동으로 정리하는 방법을 정리했습니다. 출퇴근 시스템 데이터를 보면 같은 사람의 출근 기록이 여러 번 존재하거나, 퇴근 기록도 여러 번 찍히는 경우가 많습니다. 또한 지문, 키패드 등 다양한 장치에서 기록된 데이터가 섞여 있어 그대로는 근태표로 사용하기 어려운 경우가 많습니다. 이럴 때 Power Query를 활용하면 데이터를 간단하게 정리할 수 있습니다. 기본 원리는 같은 사람과 같은 날짜를 기준으로 데이터를 그룹화한 뒤, 출근 시간은 가장 빠른 시간, 퇴근 시간은 가장 늦은 시간을 자동으로 계산하는 것입니다. 이 과정을 통해 여러 번 찍힌 기록 중에서 실제 근태에 필요한 값만 남길 수 있습니다. 또한 Power Query로 구조를 만들어두면 이후 데..

Power Query 두 컬럼 기준 중복 제거 방법 | 사고일·차량 입력용 테이블 자동 생성

Power Query를 활용해 두 개의 컬럼을 기준으로 중복 데이터를 제거하고, 입력용 테이블을 자동으로 만드는 방법을 정리했습니다. 엑셀 데이터를 정리하다 보면 사고일과 차량이 같은 중복 데이터를 제거하고, 고유한 목록만 남긴 뒤 번호를 입력할 수 있는 형태의 테이블을 만들어야 하는 경우가 있습니다. 이 작업은 엑셀 수식으로도 가능하지만, 데이터가 추가될 때마다 다시 정리해야 하는 번거로움이 있습니다. Power Query를 사용하면 이러한 과정을 자동화할 수 있습니다. 먼저 원본 데이터를 불러온 뒤, 사고일과 차량 두 컬럼을 기준으로 중복을 제거합니다. 이후 데이터를 정렬하고, 번호를 입력할 수 있도록 빈 열을 추가하여 입력용 테이블을 생성합니다. 이 구조를 만들어두면 원본 데이터가 추가되더라도 새로..

How to Count Monthly Leave Days Automatically in Excel Power Query

In Excel, employee leave dates are often stored across multiple columns such as Leave1, Leave2, Leave3, and so on. The problem is that we may need to count how many leave days each employee used in a specific month. With Power Query, this can be automated easily. In this example, the main data table is named Table1, and the target month is stored in a separate named range called TargetMonth. Pow..

Combine Multiple Tables and Calculate Totals by Code in Power Query | Table.Combine + Table.Group

When working with Excel data, it is common to have multiple tables with the same structure stored in different ranges. Manually combining and summarizing these tables can quickly become time-consuming and error-prone. In this tutorial, you will learn how to merge multiple tables into one using Power Query. Then, you will calculate totals by code using simple grouping logic. This approach automat..

Automate Excel Conditional Formatting with Python xlwings (Apply & Clear Formats)

Applying conditional formatting in Excel is useful, but managing it manually can be repetitive and time-consuming. In many testing scenarios, cell formats need to change dynamically based on data values. For example, values below a minimum or above a maximum threshold should be highlighted differently. Using Python with xlwings, you can automate both applying and removing these formats efficient..

Excel automation 2026.04.06

Power Query Lead Time Calculation | Exclude Weekends and Holidays Automatically

In many real-world scenarios, simply adding lead time to a date does not produce accurate results. Weekends and holidays must be excluded to calculate realistic delivery schedules. Handling this logic with Excel formulas can quickly become complex and difficult to maintain. In this example, you will learn how to use Power Query to calculate delivery start dates based on working days. The re..

How to Automatically Sum Quantities by Date Using Power Query (Group By Method)

In many Excel datasets, the same date often appears multiple times with different quantity values. Because of this, it is difficult to quickly identify the total quantity for each date. Manually calculating these totals can be time-consuming and prone to errors. In this tutorial, you will learn how to use Power Query to automatically group and sum quantities by date. Once set up, the results wil..