Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-2024-05-13· OpenAIAi2 WildChat-4.8M (AI2)

Excel formula, if column A has date year 2025, sum up column b

  1. User

    Excel formula, if column A has date year 2025, sum up column b

  2. Assistant

    To sum up the values in column B only if the corresponding cells in column A contain dates from the year 2025, you can use the SUMIFS function in Excel. The SUMIFS function allows you to sum values based on multiple criteria.

    Assuming your dates are in column A (e.g., A2:A100) and the values you want to sum are in column B (e.g., B2:B100), you can use the following formula:

    =SUMIFS(B2:B100, A2:A100, ">=01/01/2025", A2:A100, "<=12/31/2025")
    

    Here's a breakdown of the formula:

    • B2:B100: The range of cells containing the values you want to sum.
    • A2:A100: The range of cells that contain the dates.
    • ">=01/01/2025": The first criterion, which includes all dates from January 1, 2025, onwards.
    • "<=12/31/2025": The second criterion, which includes all dates up to December 31, 2025.

    This formula sums the values in column B only if the corresponding dates in column A fall within the year 2025.

    If your date format is different, for example, if your system uses a different date format (like dd/mm/yyyy), make sure to adjust the date strings accordingly. If you're using date cells or date functions instead of hard-coded date strings, you could use formulas like this:

    =SUMIFS(B2:B100, A2:A100, ">=" & DATE(2025,1,1), A2:A100, "<=" & DATE(2025,12,31))
    

    This approach can be more robust, especially if the date format in your region is different from the default. The DATE function constructs dates based on year, month, and day inputs.