+ Reply to Thread
Results 1 to 14 of 14

Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

  1. #1
    Registered User
    Join Date
    08-25-2016
    Location
    Zagreb
    MS-Off Ver
    365
    Posts
    6

    Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    I want to calculate only days monday - friday, without saturday and sunday. This is how it looks:

    Date Numbers
    1.7.2016 2354
    2.7.2016 1234

    When I put only one it works:

    =AVERAGE(IF(WEEKDAY(B2;2)<6;D2))

    But it doesn't work when I put range of, shows 0:

    =AVERAGE(IF(WEEKDAY(B2:B32;2)<6;D2:D32))

    I try and AVERAGEIF but give me error:

    =AVERAGEIF(B2:B32;WEEKDAY(B2:B32;2)<6;D2:D32)

  2. #2
    Forum Contributor
    Join Date
    08-23-2016
    Location
    India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    194

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Try this

    =AVERAGE(IF(WEEKDAY(B3:B33,2)<6,D2:D32))
    Ash

  3. #3
    Forum Contributor
    Join Date
    08-23-2016
    Location
    India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    194

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    enter the formula using Ctrl-Shift-Enter instead of just enter

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,721

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    This formula:

    =AVERAGE(IF(WEEKDAY(B2:B32;2)<6;D2:D32))

    is an array formula, which means that you must use Ctrl-Shift-Enter (CSE) to confirm it rather than the usual < Enter >. If you do this correctly then Excel will put curly braces { } around the formula when viewed in the formula bar, but you do not type these yourself. If you need to amend the formula then you have to use CSE again.

    Hope this helps.

    Pete

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,694

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...f-weekday.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    08-25-2016
    Location
    Zagreb
    MS-Off Ver
    365
    Posts
    6

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Quote Originally Posted by Ash_Maverick View Post
    Try this

    =AVERAGE(IF(WEEKDAY(B3:B33,2)<6,D2:D32))
    Formula error, non-US locale should be ";".

  7. #7
    Registered User
    Join Date
    08-25-2016
    Location
    Zagreb
    MS-Off Ver
    365
    Posts
    6

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Quote Originally Posted by Ash_Maverick View Post
    enter the formula using Ctrl-Shift-Enter instead of just enter
    Thanks! Now working.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,694

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Quote Originally Posted by hbartolin View Post
    Formula error, non-US locale should be ";".
    Not true for all non-US locales: we use the comma (",") in the UK, and I think it's the same in Australia and New Zealand.

  9. #9
    Registered User
    Join Date
    08-25-2016
    Location
    Zagreb
    MS-Off Ver
    365
    Posts
    6

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Quote Originally Posted by AliGW View Post
    Not true for all non-US locales: we use the comma (",") in the UK, and I think it's the same in Australia and New Zealand.
    I am in Croatia and we use ";".

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,694

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Quote Originally Posted by hbartolin View Post
    I am in Croatia and we use ";".
    Yes, but you are missing the point: your non-US locale (Croatia) uses the semi-colon, whereas my non-US locale (the UK) uses the comma. In other words, not ALL non-US locales use the semi-colon.

    If your original query is resolved, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Registered User
    Join Date
    08-25-2016
    Location
    Zagreb
    MS-Off Ver
    365
    Posts
    6

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Non-US mean non-UK... US mean as a language, we are all English by language.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,694

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Quote Originally Posted by hbartolin View Post
    Non-US mean non-UK... US mean as a language, we are all English by language.
    No, I'm afraid you are wrong about that. The UK is not in the US, it is (or was!) in Europe, and the English language started life in the British Isles, not in the US. UK computers use a UK locale setting, not a US one, and that is because US and UK English are different.

  13. #13
    Forum Contributor
    Join Date
    08-23-2016
    Location
    India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    194

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    UK English is followed and accepted world over........ except of course in US

  14. #14
    Registered User
    Join Date
    08-25-2016
    Location
    Zagreb
    MS-Off Ver
    365
    Posts
    6

    Re: Dosn't work if I use range of address (AVERAGE, IF, WEEKDAY)

    Quote Originally Posted by AliGW View Post
    No, I'm afraid you are wrong about that. The UK is not in the US, it is (or was!) in Europe, and the English language started life in the British Isles, not in the US. UK computers use a UK locale setting, not a US one, and that is because US and UK English are different.
    You make me laugh. :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Average If Weekday
    By freud1 in forum Excel General
    Replies: 3
    Last Post: 07-08-2011, 05:09 AM
  2. Average D3 on each worksheet if A1 is a weekday...
    By tecsbrain in forum Excel General
    Replies: 5
    Last Post: 11-19-2010, 07:10 PM
  3. Macro dosn't work next day
    By Dixxon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2008, 05:15 AM
  4. VBA Help, cant figure out why it dosn't work.
    By Michael A in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2006, 11:30 AM
  5. [SOLVED] average based on weekday
    By Nick in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  6. average based on weekday
    By Nick in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. average based on weekday
    By Nick in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  8. average based on weekday
    By Nick in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1