Using Left or a Wildcard in Averageif

smook

New Member
Joined
Sep 12, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Having some trouble identifying why this formula isn't working. Want to be able to get an average based of the day of the week. Was originally using the LEFT function in criteria range (ie MON, TUE etc) however swapped to a wildcard and still not returning a value.

=SUMIF(A:A,"Monday*",G:G)

1726192851332.png


Any help would be appreciated.


Cheers
Smook
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You can't use that formula since the Dates are interpreted as Numbers and your formula is for Text. Hence, a Helper column should help.

Hope this does the trick:
Cell Formulas
RangeFormula
B2:B17B2=TEXT(VALUE(WEEKDAY(A2,1)),"DDDD")
D2:D8D2=UNIQUE(B2:B17)
A3:A17A3=A2+1
E2:E8E2=COUNTIF(B2:B17,D2)
Dynamic array formulas.
 
Upvote 0
You can do it without a helper column if you use FILTER:

Cell Formulas
RangeFormula
E2:E8E2=ROWS(FILTER($B$2:$B$17,TEXT($A$2:$A$17,"dddd")=D2))
F2:F8F2=LET(f,FILTER($B$2:$B$17,TEXT($A$2:$A$17,"dddd")=D2),SUM(f)/ROWS(f))
A3:A17A3=A2+1
 
Upvote 0
Awesome! I will have to learn that LET Function. Thanks!
You can do it without a helper column if you use FILTER:

Cell Formulas
RangeFormula
E2:E8E2=ROWS(FILTER($B$2:$B$17,TEXT($A$2:$A$17,"dddd")=D2))
F2:F8F2=LET(f,FILTER($B$2:$B$17,TEXT($A$2:$A$17,"dddd")=D2),SUM(f)/ROWS(f))
A3:A17A3=A2+1
 
Upvote 0
Or try this in F2:

=AVERAGE(FILTER($B$2:$B$17,TEXT($A$2:$A$17,"dddd")=D2))
 
Upvote 0

Forum statistics

Threads
1,223,887
Messages
6,175,199
Members
452,617
Latest member
Narendra Babu D

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