+ Reply to Thread
Results 1 to 3 of 3

Standard Deviation If in vba macro

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    11

    Standard Deviation If in vba macro

    Hi all,

    I am trying to get the standard deviation of Age when the gender is Male from one worksheet and place it in another worksheet. I have already gotten the average of age for males with the handy dandy averageif worksheetfunction but I cannot seem to get this one working. Please help.

    I keep getting:
    Run-time error '1004'
    Unable to set the FormulaArray property of the Range class

    Please Login or Register  to view this content.

    I have also tried this and get type mismatch error:

    Please Login or Register  to view this content.
    I know that in the worksheet itself I can type in stdev(if(....)) and then hit control+shift+enter and it works beautifully, but I need it in a macro.

    Thanks!

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Standard Deviation If in vba macro

    Try just
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    11-06-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Standard Deviation If in vba macro

    I tried that but then I have an issue with the rest of the stuff I have in the IF function.

    If I just post a formula into cell I cannot use macro language right? For example, worksheets("Demographics").

    I really just want the value placed into the cell like my second code thing is trying to do. But I need to make it an array like control+shift+enter does in order to make it valid, I just don't know how to do that.

+ 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. Standard Deviation
    By mar_bun in forum Excel General
    Replies: 1
    Last Post: 06-29-2010, 03:19 AM
  2. Excel 2007 : Standard Deviation
    By King_Junior in forum Excel General
    Replies: 8
    Last Post: 09-18-2009, 04:02 PM
  3. [SOLVED] standard deviation
    By Arne Hegefors in forum Excel General
    Replies: 7
    Last Post: 08-06-2006, 08:15 AM
  4. [SOLVED] Standard Deviation
    By Stan Banner in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2006, 09:00 PM
  5. standard deviation
    By Chris in forum Excel General
    Replies: 1
    Last Post: 10-13-2005, 12: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