if statement for checking dates

zoog25

Active Member
Joined
Nov 21, 2011
Messages
418
Hello All,

Here is my situation that I want to see if possible. I have a sheet that contains three columns related to physical project areas. Column 1 contains a date of when the project comes to us, column 2 contains how the project has been divided (Ii.e. 5 lots, 6 lots, etc.) so it will contain only a number, column 3 will have the size of the project (i.e. lot 1 is 12 Acres), the entry just is say the number 12.

Anyways in Cell E2, E3, E4, E5, they want us to put information of all the projects divided into quarter reports, so E2 is labeled 1st Quarter, etc. So i was wondering if there was a way to just add an If statement that would look through all of Column 1, it the date in the cell matches the quarter, it would take the entry in column 2 and add them all together. So lets say A5, A7, A19 area all within the 1st Quarter of the Year (January to March) it would then add up Cells B5, B7, and B19 into E2, so if B5 = 10, B7 = 3, & B19 = 7, then E2 = 20. Please let me know if this is possible using just an IF State. I know i could properly do something with VBA but the person requesting this just like VBA formulas in a project so i just want to see if it's possible using formulas instead. Thank you for any assistance that you can provide. Please also let me know if this is impossible and that way i can see about an alternative method.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi

So you could check for the month numbers?

the below checks for jan,feb and march(1,2,3)

=IF(OR(MONTH(a1)=1,MONTH(a1)=2,MONTH(a1)=3),"yes","")

Dave
 
Upvote 0
ok great.

if you need any help with the actual formula, just ask

dave
 
Upvote 0
i did have a question, i know the formula is just for 1 cell at a time, is it possible to do a range, say like A1 to A10 for example.
 
Upvote 0
Difficult to answer exactly.

But would you mean using something like sumif()

summing the range that matches the criteria?

Dave
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Is this what you are after?

21 08 02.xlsm
ABCDE
1DateLotsSizeQtrTotal Lots
215-Jan-21510115
328-May-212826
431-Jul-213538
502-Aug-2151040
601-Apr-21410
716-Feb-21612
816-Feb-21411
9
Sum Quarters
Cell Formulas
RangeFormula
E2:E5E2=SUMPRODUCT(--(MONTH(A$2:A$8)<=3*D2),B$2:B$8)-SUM(E$1:E1)
 
Upvote 0
Solution
Yes that is what I'm looking for more specifically. I'll check on my profile to make sure that I make sure the right version is listed. The problem is that I'm sort of using two different versions of excel. The one on my personal computer and the one at work. I'll probably try to make it so it matches my work computer.
 
Upvote 0
Thanks for the info Peter_SSs. I'll review which version I'm using so I can update my information.
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

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