+ Reply to Thread
Results 1 to 2 of 2

max/min/mode with condition

  1. #1
    Registered User
    Join Date
    10-13-2021
    Location
    Slovakia
    MS-Off Ver
    365
    Posts
    7

    max/min/mode with condition

    Hi all, I would ask you, how I make macro with max/min/mode and condition.
    If I write directly to the cells function: =max(if(data=A,source)) and push ctrl+shift+enter excel convert me this function to the {=MAX(IF(C2:C227=AN2,H2:H227))} and its work correct. But I can't record this function and if I fill directly to the cell application.worksheetfunction its not working.

    I tried to this one:
    Range("ao2") = _
    "{=MAX(IF(RC[-38]:R[225]C[-38]=RC[-1],RC[-33]:R[225]C[-33]))}"
    and in cells I get only text: {=MAX(IF(RC[-38]:R[225]C[-38]=RC[-1],RC[-33]:R[225]C[-33]))}


    Could you please help me ?

  2. #2
    Registered User
    Join Date
    10-13-2021
    Location
    Slovakia
    MS-Off Ver
    365
    Posts
    7

    Re: max/min/mode with condition

    I solved my problem
    FYI:

    Range("ao2").FormulaArray = "=mode(if(c2:c227=AN2,AB2:AB227))"

+ 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. Replies: 1
    Last Post: 06-22-2017, 02:06 AM
  2. [SOLVED] VBA code works in debug mode but misses steps running in normal mode
    By supereeg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2016, 05:42 AM
  3. VBA AutoFilter does not Work in run mode, only in debug mode
    By aganove in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-19-2015, 04:32 PM
  4. [SOLVED] Code skips on Run Mode but runs fine on F8 (Debug Mode)
    By RaquelAR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-25-2013, 01:05 PM
  5. mode formula with a condition in the calculation
    By John Willcox in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2012, 08:53 AM
  6. Can I use VBA to check if the sheet(xxx) is in Page-Break mode or Normal mode ?
    By BaLLZaCH in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2008, 09:03 AM
  7. Replies: 0
    Last Post: 01-07-2005, 04:06 PM

Tags for this Thread

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