Question about Microsoft Excel for PC

1 Answer

Sumproduct or conditional sumif with multiple criteria in vba code...

Can anyone of you excel vba wiz and gurus tell me what's wrong with this code, I keep getting a Run-Time error '13': Type Mismatch error with this code.

Private Sub CommandButton1_Click()

Sheets("summary").Range("g74").Activate

Dim i As Integer
i = 74
For i = 74 To 80

ActiveCell.Offset(0, 1).Value = WorksheetFunction. _
SumProduct(--Sheets("stock card").Range("a2:a3351").Value = Sheets("summary").Range("a" & i).Value, _
--Sheets("stock card").Range("b2:b3351").Value = "", _
--Sheets("stock card").Range("e2:e3351").Value >= Sheets("summary").Range("$g$84").Value, _
Sheets("stock card").Range("k2:k3351").Value)

ActiveCell.Offset(1, 0).Activate

Next i
End Sub

Also, I would like to be able to use the "conditional sumif" function using multiple criteria arrays in lieu of the above "sumproduct" function...is this possible???

Thanks in advance, any help is most appreciated...
Jay

Posted by on

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Hot-Shot:

    An expert who has answered 20 questions.

    Corporal:

    An expert that hasĀ over 10 points.

    Mayor:

    An expert whose answer gotĀ voted for 2 times.

  • Contributor
  • 45 Answers

I'll just reply to your conditional sumif query.

yes, you can do multiple criteria query but with a matrix formula. you may look it up. nonetheless, here is how one would look like:

{=sum(if(range1=A x range2=B x range3=C, sum range))} note that x (multiplication) is used to denote intersection of the criteria

initially, you'll enter it as:
=sum(if(range1=A x range2=B x range3=C, sum range))

then, edit the cell (F2) and press ctrl+shift+enter for the brackets { } to appear.

Posted on Nov 18, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Remove VBA Password


How to Remove VBA Password - VBA Password Remover Tool to quickly or reliably recover VBA password. This software recover VBA password from your sheet/workbook project password and open MS office files. Source link:- http://www.advance.vbapasswordrecovery.net/

Apr 15, 2013 | Computers & Internet

2 Answers

What is exel sheet extension in office 2010 ?


Excel Workbook

.xlsx

The default Excel file format. Cannot store VBA macro code or Microsoft Excel 4.0 macro sheets (.xlm files in Excel 4.0).

Excel Macro-Enabled Workbook

.xlsm

Uses the same basic XML format as the Excel Workbook, but can store VBA macro code. Users saving an Excel workbook that has VBA code or Excel 4.0 macro sheets (.xlm files in Excel 4.0) are prompted to use this file format.

Excel Template

.xltx

The default file format for an Excel template. Cannot store VBA macro code or Excel 4.0 macro sheets (.xlm files in Excel 4.0).

Excel Macro-Enabled Template

.xltm

Can contain a VBAProject part or Excel 4.0 macro sheets (.xlm files in Excel 4.0). Workbooks created from this template inherit the VBAProject part or Excel 4.0 macro sheets that exist in the template.

Excel Add-In

.xlam

A supplemental program that runs additional code. Excel add-ins use the Open XML file format to store data, and they support using VBA projects and Excel 4.0 macro sheets.

Feb 21, 2011 | Computers & Internet

1 Answer

Why do i loose my custom Views in Excell 2003 when I add drop down lists?


Have you tried to save them as a custom worksheet template? See this tip , this one, this tip, and site for other tips related. (For saving custom views of filtering criteria, see here and here.)
Here is the MS article that thoroughly explains the means for using VBA codes to customize your excel 2003 command bars.

I hope this information allows you to resolve this issue. If you need further assistance, please post back with a comment to this thread.
If I've managed to answer your question or solve a problem, please take just a moment to rate this post....thanks!


Aug 26, 2009 | Microsoft Office Excel 2007

2 Answers

Excel farmulas


Add another colum, say D with result of B*C

Do a list of the different cat, and use sumif
For cat 0101 (in cell F1)
formula to put in G1
=sumif($A$1:$A$7000;F1;$D$1:$D$7000) where F1 contain 0101

expand the formula for other cat. (G2, G3, etc)

You can use a assistant to extract the distinct cat from A1:A7000, sorting them and copy the result in F (Menu Data-> Filter -> elaborate filter)

Feb 16, 2009 | Microsoft Excel for PC

1 Answer

Need Formula


TEXT CASE
Convert to UPPER, Proper or lower
Auto Convert to UPPER, Proper or lower
Stop VBA Being Case Sensitive

SELECT CASE VBA
Select Case Statement. Great alternative to Else If Statements

CONVERSION
VBA: CBool(),CByt(),CCur(),CDate(),CDbl()Double,CDec(),CInt(),CLng(),CSng(),CStr(),CVar().
Example
dDate=cDate("25-Jan-07")
Convert Numbers to Words
Convert Numbers to Dollar Amount in Words
Spreadsheet Converter. Versions: HTML/JavaScript,Excel ASP.Net and Excel Java/JSP. $
SQL Database Migration $
Converters. Database Converters, Spreadsheet Converters, Text Converters, E-mail Conversion, Document Conversion, PDF Conversion and more! $
CSV Converter $

IMPORTING
Import SQL Into Excel-SQL Tester $
Import Excel Into Access $

CONDITIONAL FORMATTING
Conditional Formatting
More Than 3 Conditional Formats
Conditional Format Fonts for greater than 3

CUSTOM FORMATS
Custom Formats
Excel see a cells format as having four Sections. These are, from left to right: Positives;Negatives;Zeros;Text.

To hide zeros cell-by-cell use a Custom Number Format like 0.00;-0.00; where 0.00 is desired format for non zeros. Note the use of -0.00 for negatives.

To hide zeros on the Workbook level go to Tools>Options>View - Zero Values.

Dec 15, 2008 | Microsoft Windows XP Home Edition

1 Answer

Excel counting


Use Pivot table, it might help you reach your target..!!

Aug 12, 2008 | Microsoft Excel for PC

1 Answer

SUMIF formula


One in general should not use Find & Replace.
I would recommend always creating the first formula manually by selecting the cells. This will avoid common errors like extra spaces.

May 11, 2008 | Microsoft Excel for PC

1 Answer

Excel formula


Yes, there is a function in MS Excel called "sumproduct" which multiplies the componenets in an array or arrays, then totals the result, eg :

=SUMPRODUCT(D4:D20,B4:B20) ...Job done...Enjoy !

Jan 16, 2008 | Microsoft Excel for PC

3 Answers

Excel vba password recovery


You can but you will need software. Search for google for VBA password recovery tools. Search for the appropriate crack you have it all . .

Dec 30, 2007 | Microsoft Excel for PC

1 Answer

Using if and then to add values to a cell


Try using the SUMIF function for one condition or multiple conditions. Use the SUMIF worksheet function to create a total value for one range based on a value in another range. For example, for every cell in the rage B5:B25 that contains the value "Northwind", the following formula calculates the total for the corresponding cells in the range F5:F25. Formula:
=sumif(B5:B25,"Northwind",F5:F25)

Here are SUMIF functions for multiple conditions.

=sum(if((B5:B25="Northwind")*(C5:C25="Western"),F5:F25))

=sum(if((B5:B25="Northwind")+(C5:C25="Western"),F5:F25))

=sum(if(B5:B25="Northwind",IF(C5:C25="Western"),1,0)))

Also check your help for SUMIF functions.

If this helps you, Please rate me. Thanks, Patty

Dec 09, 2007 | Computers & Internet

Not finding what you are looking for?
Microsoft Excel for PC Logo

3,905 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2642 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18343 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...