mercredi 26 septembre 2018

Comparing dates in Excel and adding a set of cells

I am trying to compare a series of cells in a column to match a particular month and if it matches, I want to add the value from a particular cell.

For example, If the month value in A1 to A50 is December, I want to add C1 to C50. If anything in between A1 to A50 is not December, then it would add 0 for that particular cell.

I was able to implement it by using sum, if and month commands. But, I was not able to use arrays to check the month, which is making the formula complicated and huge for a large number of cells.

Is it possible to use an array to implement this.

=sum(if(month(A1)=9, C1, 0),if(month(A2)=9, C2, 0))

Aucun commentaire:

Enregistrer un commentaire