if then statment

Turwin

New Member
Joined
Oct 10, 2019
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
I need a formula that will look at the dates in a column and if between X and Y then sum(range)

I am working on calculating quarterly totals, so I want it to look in colA for date between 01/01/2019 and 03/31/2019 then add that range totals from column E

col A Col B c d e
[TABLE="width: 538"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Date week ending[/TD]
[TD]Transaction Code[/TD]
[TD] Gross pay [/TD]
[TD]Vac Pay[/TD]
[TD]Total Pay[/TD]
[/TR]
[TR]
[TD="align: right"]1/27/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,150.00[/TD]
[TD] $ 126.00[/TD]
[TD="align: right"]$3,276.00[/TD]
[/TR]
[TR]
[TD="align: right"]2/3/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,000.00[/TD]
[TD] $ 120.00[/TD]
[TD="align: right"]$3,120.00[/TD]
[/TR]
[TR]
[TD="align: right"]2/10/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,000.00[/TD]
[TD] $ 120.00[/TD]
[TD="align: right"]$3,120.00[/TD]
[/TR]
[TR]
[TD="align: right"]2/17/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,000.00[/TD]
[TD] $ 120.00[/TD]
[TD="align: right"]$3,120.00[/TD]
[/TR]
[TR]
[TD="align: right"]2/24/2019[/TD]
[TD]Stat Holiday Pay[/TD]
[TD] $ 631.80[/TD]
[TD] $ 25.27[/TD]
[TD="align: right"]$657.07[/TD]
[/TR]
[TR]
[TD="align: right"]2/24/2019[/TD]
[TD]Regular[/TD]
[TD] $ 2,550.00[/TD]
[TD] $ 102.00[/TD]
[TD="align: right"]$2,652.00[/TD]
[/TR]
[TR]
[TD="align: right"]3/3/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,225.00[/TD]
[TD] $ 129.00[/TD]
[TD="align: right"]$3,354.00[/TD]
[/TR]
[TR]
[TD="align: right"]3/10/2019[/TD]
[TD]Expense Reimbursement[/TD]
[TD] $ 535.53[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3/10/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]3/10/2019[/TD]
[TD]Overtime[/TD]
[TD] $ 787.50[/TD]
[TD] $ 31.50[/TD]
[TD="align: right"]$819.00[/TD]
[/TR]
[TR]
[TD="align: right"]3/17/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]3/24/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]3/31/2019[/TD]
[TD]Overtime[/TD]
[TD] $ 787.50[/TD]
[TD] $ 31.50[/TD]
[TD="align: right"]$819.00[/TD]
[/TR]
[TR]
[TD="align: right"]3/31/2019[/TD]
[TD]Expense Reimbursement[/TD]
[TD] $ 241.75[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3/31/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]4/7/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]4/14/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]4/21/2019[/TD]
[TD]Regular[/TD]
[TD] $ 2,850.00[/TD]
[TD] $ 114.00[/TD]
[TD="align: right"]$2,964.00[/TD]
[/TR]
[TR]
[TD="align: right"]4/21/2019[/TD]
[TD]Stat Holiday Pay[/TD]
[TD] $ 687.98[/TD]
[TD] $ 27.52[/TD]
[TD="align: right"]$715.50[/TD]
[/TR]
[TR]
[TD="align: right"]4/28/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]5/5/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]5/12/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]5/19/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]5/26/2019[/TD]
[TD]Regular[/TD]
[TD] $ 2,700.00[/TD]
[TD] $ 108.00[/TD]
[TD="align: right"]$2,808.00[/TD]
[/TR]
[TR]
[TD="align: right"]5/26/2019[/TD]
[TD]Stat Holiday Pay[/TD]
[TD] $ 686.40[/TD]
[TD] $ 27.46[/TD]
[TD="align: right"]$713.86[/TD]
[/TR]
[TR]
[TD="align: right"]6/2/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]6/9/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]6/16/2019[/TD]
[TD]Regular[/TD]
[TD] $ 3,300.00[/TD]
[TD] $ 132.00[/TD]
[TD="align: right"]$3,432.00[/TD]
[/TR]
[TR]
[TD="align: right"]6/23/2019[/TD]
[TD]Overtime[/TD]
[TD] $ 787.50[/TD]
[TD] $ 31.50[/TD]
[TD="align: right"]$819.00[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Upvote 0
Conditional Formatting can only run off of values, not off of other formatting.
If the dates in column A are turned green by Conditional Formatting, you should just be able to use the same conditions that turned them green.
 
Upvote 0
Conditional Formatting can only run off of values, not off of other formatting.
If the dates in column A are turned green by Conditional Formatting, you should just be able to use the same conditions that turned them green.

how would I do date range in the formula? =sumifs(H:H,D:D,"1/1/2019:3/31/2019")
 
Upvote 0
Did you take a look at the link I provided in my first reply?
Here is one that might be a little better, as they hard-code the dates right in the formula (instead of using cell references that hold the dates).
https://www.spreadsheetweb.com/how-to-sum-values-between-two-dates/
You should be able to set yours up exactly the same way, so just follow that model.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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