Sum one column for all cells that have the previous day/current month/previous month in another column

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
929
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am looking for 3 sumif formulas but am unsure how to write them.

What I am trying to do is Sum all of column F based on the corresponding date in column G.
So Sum all cells in F that have the previous day (TODAY()-1)) in G: (formula one), current month (formula 2) and previous month (formula 3)

I am not sure how to write this.

Thank you for all of your help

Carla
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
You can give an example of your information and the result you expect.
 
Upvote 0
[TABLE="width: 144"]
<tbody>[TR]
[TD]Column F[/TD]
[TD][/TD]
[TD]Column G[/TD]
[/TR]
[TR]
[TD]100[/TD]
[TD][/TD]
[TD]24-Sep[/TD]
[/TR]
[TR]
[TD]250[/TD]
[TD][/TD]
[TD]22-Sep[/TD]
[/TR]
[TR]
[TD]50[/TD]
[TD][/TD]
[TD]01-Aug[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD]10-Aug[/TD]
[/TR]
[TR]
[TD]200[/TD]
[TD][/TD]
[TD]22-Jul[/TD]
[/TR]
[TR]
[TD]50[/TD]
[TD][/TD]
[TD]05-Sep[/TD]
[/TR]
</tbody>[/TABLE]

1st formula I want to sum everything in column F that is yesterdays date. Result: 100
2nd formula I want to sum everything in column F that is the current month. Result: 400
3rd formula I want to sum everything in column F that is the previous month. Result: 60

NOTE: The columns may not necessarily be beside eachother, They may be F and D for example.

Hope this clarifies everything. Thank you so much for your help
 
Last edited:
Upvote 0
How about:

<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:84.59px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:149.23px;" /><col style="width:132.12px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >F</td><td >G</td><td >H</td><td >I</td><td >J</td><td >K</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td >VALUE</td><td >DATE</td><td > </td><td >Yesterday</td><td >current month</td><td >previous month</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="text-align:right; ">100</td><td style="text-align:right; ">24-sep</td><td > </td><td style="text-align:right; ">100</td><td style="text-align:right; ">400</td><td style="text-align:right; ">60</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="text-align:right; ">250</td><td style="text-align:right; ">22-sep</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="text-align:right; ">50</td><td style="text-align:right; ">01-ago</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="text-align:right; ">10</td><td style="text-align:right; ">10-ago</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="text-align:right; ">200</td><td style="text-align:right; ">22-jul</td><td > </td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="text-align:right; ">50</td><td style="text-align:right; ">05-sep</td><td > </td><td > </td><td > </td><td > </td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formeula</td></tr><tr><td >I2</td><td >=SUMIFS(F2:F7,G2:G7,TODAY()-1)</td></tr><tr><td >J2</td><td >=SUMPRODUCT((MONTH(G2:G7)=MONTH(TODAY()))*(F2:F7))</td></tr><tr><td >K2</td><td >=SUMPRODUCT((MONTH(G2:G7)=MONTH(TODAY())-1)*(F2:F7))</td></tr></table></td></tr></table>
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,138
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top