+ Reply to Thread
Results 1 to 3 of 3

Having problem with inserting inequality in SUMIF

Hybrid View

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    Tehran, Iran
    MS-Off Ver
    Excel 2013
    Posts
    7

    Having problem with inserting inequality in SUMIF

    I have this SUMIF function with the criteria defined as Crt.

    Sub Test()
        Dim Crt
            Crt = "1.5"
            ActiveCell.FormulaR1C1 = _
            "=SUMIF(R2C23:R39C23," & Crt & ",R2C6:R39C6)"
    End Sub
    It works when Crt is a value(eg. Crt="1.5"), but when I try to change it to inequality (eg. Crt= ">=1.5"), Run time error '1004' occurs.

    I'd appreciate any help!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Having problem with inserting inequality in SUMIF

    Maybe

    ActiveCell.FormulaR1C1 = "=SUMIF(R2C23:R39C23,""" & Crt & """,R2C6:R39C6)"
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-29-2012
    Location
    Tehran, Iran
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Having problem with inserting inequality in SUMIF

    I'm so grateful for your help!

    It's working... I think I get it now! It's because SUMIF formula works when you insert a number without any quotation mark! But when it comes to inequality it has to be in quotation!

    again, thank you!
    Last edited by Haleh; 01-26-2014 at 08:57 AM.

+ 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. Evaluate String Inequality as Boolean
    By bsamuels in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2012, 04:35 PM
  2. Solve inequality using IF function
    By meeya in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 10-11-2012, 09:24 AM
  3. Inequality in Excel (VBA)
    By excelit in forum Excel General
    Replies: 6
    Last Post: 03-04-2011, 10:54 AM
  4. Inequality Incorrect?
    By SDruley in forum Excel General
    Replies: 3
    Last Post: 02-12-2011, 01:02 PM
  5. [SOLVED] How do I write inequality?
    By Margaret in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-05-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