subtracting values based on time remaining

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,075
Hello all,

I feel like I'm just slightly off on this formula: I am trying to sum a range of values, then subtract the total of all values where the time remaining is less that 1 year.

Code:
=(SUMIF(K3:K22,"<>"&"",D3:D22))-(SUMIF(K3:K22,[COLOR=#b22222]"<365"[/COLOR] &"",D3:D22))

=(SUMIF(K3:K22,"<>"&"",D3:D22))-(SUMIF(K3:K22,"GONE!" &"",D3:D22))
The second formula works perfect for removing data where the cell in Column K reflects Gone since there are no more days remaining.
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Vbagreenhorn1

Board Regular
Joined
Feb 3, 2017
Messages
125
What is the problem and what is the purpose of the &"" in the formula?

What is in column K and how are the values getting in that column?
 

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,075
Here is the formula in K:
Code:
=IF(B3>F3,"GONE!",INT((F3-B3)/365)&"Y  "&INT(MOD((F3-B3),365)/30)&"M  "&ROUND(MOD((MOD((F3-B3),365)),30),0)&"D")

F3 & B3 are simple date values:ex 12/03/17
 

Watch MrExcel Video

Forum statistics

Threads
1,122,554
Messages
5,596,814
Members
414,104
Latest member
imamalidadashzada

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
Top