Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Sumif not equal to

I've tried both options and end up with the same thing. MyFormula = "ode"

Here's exactly how I have it written (with the option since it was the last
one tried)

MyFormula = Mid(ActiveCell.Formula, 2, Len(ActiveCell.Formula))
ActiveCell.Formula = "=IF(ISERROR(" & MyFormula & "),"",(" & MyFormula & "))"

Also if it helps here's what I'm changing from and to:
=AVERAGE(OFFSET(C15,-3,0,-12,1))
=IF(ISERROR(AVERAGE(OFFSET(C15,-3,0,-12,1))),"",(AVERAGE(OFFSET(C15,-3,0,-12,1))))






"StephanieH" wrote:

I need to sum column B if column A does not contact the words Large Balance.
I'm not sure how or where to designate the not like part.

Application.WorksheetFunction.SumIf(Columns("A") , < "Large Balance",
Columns("B"))
returns a syntax error

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sumif not equal to

You have to double up those double quotes in strings:

MyFormula = Mid(ActiveCell.Formula, 2, Len(ActiveCell.Formula))
ActiveCell.Formula = "=IF(ISERROR(" & MyFormula & "),"""",(" & MyFormula & "))"
or
MyFormula = Mid(ActiveCell.Formula, 2)
ActiveCell.Formula = "=IF(ISERROR(" & MyFormula & "),"""",(" & MyFormula & "))"

Excel's =Mid() function works differently than VBA's Mid function. You don't
need to specify that last parm.

StephanieH wrote:

I've tried both options and end up with the same thing. MyFormula = "ode"

Here's exactly how I have it written (with the option since it was the last
one tried)

MyFormula = Mid(ActiveCell.Formula, 2, Len(ActiveCell.Formula))
ActiveCell.Formula = "=IF(ISERROR(" & MyFormula & "),"",(" & MyFormula & "))"

Also if it helps here's what I'm changing from and to:
=AVERAGE(OFFSET(C15,-3,0,-12,1))
=IF(ISERROR(AVERAGE(OFFSET(C15,-3,0,-12,1))),"",(AVERAGE(OFFSET(C15,-3,0,-12,1))))

"StephanieH" wrote:

I need to sum column B if column A does not contact the words Large Balance.
I'm not sure how or where to designate the not like part.

Application.WorksheetFunction.SumIf(Columns("A") , < "Large Balance",
Columns("B"))
returns a syntax error


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to sumif in excel with a not equal criteria Ed New Users to Excel 2 April 30th 23 07:45 PM
SUMIF using 2 cells that equal each other wormburner Excel Discussion (Misc queries) 1 February 4th 10 08:18 PM
SUMIF Greater than or equal to envy Excel Worksheet Functions 4 October 29th 09 12:56 AM
Sumif not equal to JE McGimpsey Excel Programming 0 January 22nd 07 07:14 PM
sumif if cell does not equal #N/A Micah Excel Discussion (Misc queries) 1 February 2nd 06 09:41 PM


All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"