View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Squeaky Squeaky is offline
external usenet poster
 
Posts: 155
Default need help writing function

LQQKB4uleep,

Each of these should have worked for you given the information you provided.

In your example, what cell is the first "Sunday" in? In my formula I assumed
A1, and the formula is placed in C1. If the first Sunday is not in A1,
whatever cell it is in exchange that for "A1", then drag it down for the
other days of the week.
My Formula:

=SUMIF(A:A,A1,B:B)
=SUMIF(A:A,A2,B:B)
=SUMIF(A:A,A3,B:B)

Jabob's first formula basically said the same thing as mine except he put
"Sunday" in place of A1. With his, you would need to drag it down and then
replace the "Sunday" with another day.
Jacob's formula:

=SUMIF(A:A,"Sunday",B:B)
=SUMIF(A:A,"Monday",B:B)
=SUMIF(A:A,"Tuesday",B:B)


"LQQKB4uleep" wrote:

Column A has Days of the week listed for the entire month
Column B has data listed for days of the week
Want formula to count data in column B if it equals a certain day of the week

like if sunday then count all data listed for sundays in column B

"a" "B"
Sunday 21
Monday 15
Tuesday 28

Sunday 14
Monday 10
Tuesday 12

sunday=35
Monday=25
Tuesday=40