Install any skill in seconds. Free to start, no credit card required.
Get Started Free →对比Excel多表中的特定系数并对异常值进行颜色标记。
.claude/skills/opensensenova-excel-conditional-comparison-and-large-file-processing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-21 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -17% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-22 | ✓→✓ | = Same ✓ | 50% | 0% |
| case-23 | ✓→✓ | = Same ✓ | 23% | 0% |
> This sub-skill covers one capability of the Excel workflow. For reading/counting/Parquet optimization, see the parent workflow SKILL.md.
Step1 提取不同Sheet中特定维度(如“B1层”)的数值,并进行跨表逻辑对比。
python# 定义提取逻辑:定位目标行(如包含'B1'的行)并获取其关联的系数 def extract_target_value(df, target_label='B1', label_col_idx=0, offset_row=1, value_col_idx=2): """ 在指定列搜索标签,并返回其相对偏移位置的数值 """ extracted_values = [] for idx, row in df.iterrows(): if str(row.iloc[label_col_idx]).strip() == target_label: # 提取目标行下方或特定偏移位置的数值 if idx + offset_row < len(df): val = df.iloc[idx + offset_row].iloc[value_col_idx] extracted_values.append(val) return extracted_values # 分别读取需要对比的Sheet sheet1_df = pd.read_excel(file_path, sheet_name='Sheet1') sheet2_df = pd.read_excel(file_path, sheet_name='Sheet2') # 提取系数(示例:B1层的换算系数) # 注意:不同Sheet的列索引可能不同,需根据实际结构调整 s1_coeffs = extract_target_value(sheet1_df, target_label='B1', label_col_idx=1, value_col_idx=3) s2_coeffs = extract_target_value(sheet2_df, target_label='B1', label_col_idx=0, value_col_idx=2) # 汇总对比数据 comparison_results = [] target_standard = 0.6 # 预设的标准阈值 for val in s1_coeffs: comparison_results.append({'source': 'Sheet1', 'value': val, 'is_anomaly': val != target_standard}) for val in s2_coeffs: comparison_results.append({'source': 'Sheet2', 'value': val, 'is_anomaly': val != target_standard})
Step2 生成对比报告,并使用 openpyxl 对异常值(非标准系数)进行红色高亮标记。
pythonfrom openpyxl import Workbook from openpyxl.styles import PatternFill output_path = 'comparison_report.xlsx' wb = Workbook() ws = wb.active ws.title = "Comparison Analysis" # 写入表头 headers = ['数据来源', '提取数值', '是否符合标准', '状态标记'] ws.append(headers) # 定义红色填充样式 red_fill = PatternFill(start_color='FF0000', end_color='FF0000', fill_type='solid') # 遍历结果并写入,同时应用条件格式 for item in comparison_results: status_text = '正常' if not item['is_anomaly'] else '异常(非0.6)' row_data = [item['source'], item['value'], '是' if not item['is_anomaly'] else '否', status_text] ws.append(row_data) # 如果是异常值,将该行或特定单元格标红 if item['is_anomaly']: curr_row = ws.max_row for col_idx in range(1, len(headers) + 1): ws.cell(row=curr_row, column=col_idx).fill = red_fill # 保存结果并提供下载 wb.save(output_path) print(f"Analysis complete. Report saved to: {output_path}")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | fail→fail | 16,148 | 14,715 | -9% | 1 | 1 | 0% | 3,076 | 3,987 | +30% | 0 | 0 | — |
case-21 | fail→pass | 20,777 | 16,610 | -20% | 1 | 1 | 0% | 3,383 | 4,025 | +19% | 0 | 0 | — |
case-22 | pass→pass | 9,301 | 10,248 | +10% | 1 | 1 | 0% | 1,988 | 2,976 | +50% | 0 | 0 | — |
case-23 | pass→pass | 12,237 | 10,841 | -11% | 1 | 1 | 0% | 2,499 | 3,065 | +23% | 0 | 0 | — |
case-01 | fail→pass | 21,177 | 11,544 | -45% | 1 | 1 | 0% | 4,261 | 3,528 | -17% | 0 | 0 | — |
case-02 | fail→fail | 29,472 | 14,428 | -51% | 1 | 1 | 0% | 4,838 | 4,075 | -16% | 0 | 0 | — |
case-03 | fail→pass | 19,791 | 14,016 | -29% | 1 | 1 | 0% | 4,368 | 3,949 | -10% | 0 | 0 | — |
case-04 | pass→pass | 15,087 | 8,186 | -46% | 1 | 1 | 0% | 1,937 | 2,230 | +15% | 0 | 0 | — |
case-05 | fail→fail | 16,661 | 16,065 | -4% | 1 | 1 | 0% | 2,436 | 3,407 | +40% | 0 | 0 | — |
case-06 | pass→pass | 3,706 | 2,704 | -27% | 1 | 1 | 0% | 496 | 1,338 | +170% | 0 | 0 | — |
case-07 | pass→pass | 5,928 | 3,067 | -48% | 1 | 1 | 0% | 1,202 | 1,463 | +22% | 0 | 0 | — |
case-08 | pass→pass | 8,906 | 7,264 | -18% | 1 | 1 | 0% | 1,586 | 2,167 | +37% | 0 | 0 | — |
case-09 | pass→pass | 2,623 | 2,153 | -18% | 1 | 1 | 0% | 465 | 1,259 | +171% | 0 | 0 | — |
case-10 | pass→pass | 2,635 | 2,731 | +4% | 1 | 1 | 0% | 485 | 1,336 | +175% | 0 | 0 | — |
case-11 | pass→pass | 3,257 | 4,057 | +25% | 1 | 1 | 0% | 545 | 1,456 | +167% | 0 | 0 | — |
case-12 | pass→pass | 3,413 | 3,507 | +3% | 1 | 1 | 0% | 561 | 1,477 | +163% | 0 | 0 | — |
case-13 | pass→pass | 2,496 | 3,055 | +22% | 1 | 1 | 0% | 473 | 1,290 | +173% | 0 | 0 | — |
case-14 | pass→pass | 2,596 | 2,213 | -15% | 1 | 1 | 0% | 417 | 1,274 | +206% | 0 | 0 | — |
case-15 | pass→pass | 5,286 | 2,784 | -47% | 1 | 1 | 0% | 828 | 1,407 | +70% | 0 | 0 | — |
case-16 | pass→pass | 3,112 | 2,186 | -30% | 1 | 1 | 0% | 397 | 1,245 | +214% | 0 | 0 | — |
case-17 | pass→pass | 8,520 | 8,569 | +1% | 1 | 1 | 0% | 1,653 | 2,091 | +26% | 0 | 0 | — |
case-18 | pass→pass | 2,421 | 2,394 | -1% | 1 | 1 | 0% | 403 | 1,273 | +216% | 0 | 0 | — |
case-19 | pass→pass | 9,264 | 7,796 | -16% | 1 | 1 | 0% | 1,681 | 2,429 | +44% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.