Forum Discussion

sybtan05's avatar
sybtan05
Copper Contributor
Oct 14, 2025

Data Reconciliation Assistance Needed – Time Range & Sum Matching

I have two sets of data that need to be reconciled. Specifically, I’m trying to identify which combinations of numbers from these datasets can sum up to a specific target value.

Additionally, the reconciliation should only consider entries that fall within a defined time range—from approximately 8:00 AM on one day to 10:00 PM the following day.

I’ve tried using Solver and Goal Seek, but the results don’t seem accurate. I also attempted using Microsoft Copilot, but the outcome still appears incorrect.

Could you assist with identifying or generating the correct combinations based on the criteria above?

1 Reply

  • Python may help:

     

    import itertools
    import pandas as pd
    
    # Load datasets
    df1 = pd.read_excel("dataset1.xlsx")
    df2 = pd.read_excel("dataset2.xlsx")
    
    # Filter by time range
    start = pd.Timestamp("2025-11-16 08:00")
    end   = pd.Timestamp("2025-11-17 22:00")
    
    df1 = df1[(df1['timestamp'] >= start) & (df1['timestamp'] <= end)]
    df2 = df2[(df2['timestamp'] >= start) & (df2['timestamp'] <= end)]
    
    # Combine values
    values = list(df1['amount']) + list(df2['amount'])
    
    target = 1000  # example target sum
    
    # Find combinations
    for r in range(2, len(values)+1):
        for combo in itertools.combinations(values, r):
            if sum(combo) == target:
                print(combo)

     

Resources