ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Compare the value of one cell to 2 different cells (https://www.excelbanter.com/excel-discussion-misc-queries/215169-compare-value-one-cell-2-different-cells.html)

needexcelhelp

Compare the value of one cell to 2 different cells
 
Hi,
I need some help. I'm trying to do the following without having to count
cells then adding them in different work sheets. Please let me know if my
explantion is not good.

I want to sum up the total number of instances that falls within a date
range. For example, if value in the A column is = B1 AND <= B2 then C1 =
C1+1

A B C
1 12-1-2008 12-1-2008
2 12-8-2008 12-8-2008
3 10-1-2008
4 12-5-2009
5 12-1-2008




Lars-Åke Aspelin[_2_]

Compare the value of one cell to 2 different cells
 
On Fri, 2 Jan 2009 11:40:01 -0800, NeedExcelHelp
wrote:

Hi,
I need some help. I'm trying to do the following without having to count
cells then adding them in different work sheets. Please let me know if my
explantion is not good.

I want to sum up the total number of instances that falls within a date
range. For example, if value in the A column is = B1 AND <= B2 then C1 =
C1+1

A B C
1 12-1-2008 12-1-2008
2 12-8-2008 12-8-2008
3 10-1-2008
4 12-5-2009
5 12-1-2008



Try this formula in cell C1:

=SUMPRODUCT((A1:A5=B1)*(A1:A5<=B2))

Hope this helps / Lars-Åke

Elkar

Compare the value of one cell to 2 different cells
 
Try this:

=SUMPRODUCT(--(A1:A5=B1),--(A1:A5<=B2))

HTH
Elkar


"NeedExcelHelp" wrote:

Hi,
I need some help. I'm trying to do the following without having to count
cells then adding them in different work sheets. Please let me know if my
explantion is not good.

I want to sum up the total number of instances that falls within a date
range. For example, if value in the A column is = B1 AND <= B2 then C1 =
C1+1

A B C
1 12-1-2008 12-1-2008
2 12-8-2008 12-8-2008
3 10-1-2008
4 12-5-2009
5 12-1-2008




T. Valko

Compare the value of one cell to 2 different cells
 
Try this:

=SUMPRODUCT(--(A1:A5=B1),--(A1:A5<=B2))

--
Biff
Microsoft Excel MVP


"NeedExcelHelp" wrote in message
...
Hi,
I need some help. I'm trying to do the following without having to count
cells then adding them in different work sheets. Please let me know if my
explantion is not good.

I want to sum up the total number of instances that falls within a date
range. For example, if value in the A column is = B1 AND <= B2 then C1 =
C1+1

A B C
1 12-1-2008 12-1-2008
2 12-8-2008 12-8-2008
3 10-1-2008
4 12-5-2009
5 12-1-2008






Shane Devenshire[_2_]

Compare the value of one cell to 2 different cells
 
Hi,

And if your in 2007 you can also use

=COUNTIFS(A1:A12,"="&B1,A1:A12,"<="&B2)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"NeedExcelHelp" wrote:

Hi,
I need some help. I'm trying to do the following without having to count
cells then adding them in different work sheets. Please let me know if my
explantion is not good.

I want to sum up the total number of instances that falls within a date
range. For example, if value in the A column is = B1 AND <= B2 then C1 =
C1+1

A B C
1 12-1-2008 12-1-2008
2 12-8-2008 12-8-2008
3 10-1-2008
4 12-5-2009
5 12-1-2008





All times are GMT +1. The time now is 04:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com