lockhrt
lockhrt

Reputation: 875

How to select/filter rows in MS Excel based on cell value

I'm working on an excel sheet which has a simple structure like this.

 Date          |  Order
 -----------------------
 08-15-2014    |  84
 08-16-2014    |  50
 08-17-2014    |  68
 08-17-2014    |  78
 08-18-2014    |  23

Here, in a separate column I'd like to calculate the sum of Orders by week days(Sunday, Monday and so on). Meaning, I want to see how many Orders received on Sunday, Monday etc.

So far I have come up with this non working formula.

=SUM(LOOKUP(1, WEEKDAY(date_column), order_column))

This was example for summing all order received on Sunday. And, yes Date column is in DateTime Data type so that shouldn't be a problem.

Thanks.

Upvotes: 0

Views: 2790

Answers (1)

AureliusPhi
AureliusPhi

Reputation: 433

Consider adding a new column after the dates, representing the day values. So in column B you might have something like =TEXT(WEEKDAY(A2),"ddd").

Then if you wanted to sum up order numbers by day, you could use an equation like =SUMIF(B1:B5,"Sun",C1:C5) where column B has the day values and column C has the order numbers.

To show an example (with headers, etc):

enter image description here

Upvotes: 1

Related Questions