Forum Discussion

Sarahh2831's avatar
Sarahh2831
Copper Contributor
Apr 14, 2023
Solved

Formula

Hi    I want to use sumifs as I multiple criteria    tab 1  Jan-23 <need total positive value > jan-23 <need total negative value> Feb-23 <need total positive values> feb-23 <need total negat...
  • NikolinoDE's avatar
    NikolinoDE
    Apr 15, 2023

    Sarahh2831 

    You can make the formula more flexible by using cell references instead of hard-coded dates. For example, you can enter the start and end dates for the desired month in two cells in Tab 1, let’s say cells C1 and D1. Then you can modify the formula to reference these cells instead of using hard-coded dates.

    Here’s an example of how the modified formula for calculating the total positive values for the month specified in cells C1 and D1 would look like:

    =SUMIFS(Tab2!B:B, Tab2!A:A, ">="&C1, Tab2!A:A, "<"&D1, Tab2!B:B, ">0")

    Similarly, you can modify the formula for calculating the total negative values for the month specified in cells C1 and D1 as follows:

    =SUMIFS(Tab2!B:B, Tab2!A:A, ">="&C1, Tab2!A:A, "<"&D1, Tab2!B:B, "<0")

    With these modified formulas, you can easily change the month for which you want to calculate the total positive and negative values by simply changing the dates in cells C1 and D1.

     

    I wish you a nice day and much success with Excel!

Resources