# Sumproduct/Countif/And/Or Query

Feb 14, 2008

a calculation that has some conditions. I have a spreadsheet where I am calculating how many cells fall within a month date range using forumla :=SUMPRODUCT(('Project Team Actions'!J8:J525S2)) - as it calculates via other worksheets, but I only want it to count the cells that have OPEN or On Going in a neighbouring column, but not count the items that are closed.

ADVERTISEMENT

## Sumproduct Vs Countif

Jul 2, 2009

I have a worksheet where I am trying to count the number of occurences of several text strings.

For example:

I'm trying to count how many times "paid in full" and "fully paid" occur in column A.

I have two formulas, and both seem to work, but since I don't really understand either of them, I'm wondering which I should use and how I would adapt it to include additional text strings. (Like adding "paid" to the list)

Here are my formuals (I didn't write either of them, another co-worker did)

=(COUNTIF(A:A,"paid in full"))+(COUNTIF(A:A,"fully paid"))

=SUMPRODUCT(--(A1:A50={"paid in full","fully paid"}))

Also, if there is another and easier way to do what I'm trying to do, I'd love to know.

## Sumproduct/Countif

Jun 29, 2006

I am working off a seperate worksheet and trying to use a Sumproduct with multiple criterias along with one criteria that calculate all fileds that =<45. The formula I am using is listed below. I get #VALUE!

=SUMPRODUCT(--('Q2-PDR Query BW'!A1:A200="Yes"),--('Q2-PDR Query BW'!B1:B200="Health Net"),--('Q2-PDR Query BW'!C1:C200="Closed"),--('Q2-PDR Query BW'!U1:U200="<=45"))

## Countif/Sumproduct Function?

Mar 9, 2009

I am trying to count number of staff working in any day without deleting the empty cells.(see attached sample sheet). I tried sumproduct as I have two criteria but it is giving me a "zero" result. I only want to count cells in range B3:B32 that does not have "#" sign if there is a staff name if there is a staff name id corresponding cell in Column A within A3:A32.

## Using Weeknum With Countif Or Sumproduct

Feb 24, 2014

Essentially I have the following:

Sheet 1 (raw data)
column a = day
column b = weeknum
column c = Employee Name (5 names)

Sheet 2 (sheet I would like to create graphs)

I need to sum total records of each employee per week. For example:

column a2:a6 are each possible employee name
column b1:h1 are weeknums 1-7

I've tried countif but I'm only able to make that work if there's a helper column.

## Change Sumproduct To Countif(and(

Apr 8, 2009

Change Sumproduct to countif(and(. I'm using this formula

## Countif/sumproduct Formula

Oct 22, 2008

I have a sheet with repeated dates for several months and I need to break out data by week and then by certain criteria. I can do 1 or the other but combining the COUNTIF formula and the SUMPRODUCT formula has proven to be beyond me.

I have this now:

=SUMPRODUCT(--(D2:D31719"7/19/2008"+0),--(G2:G31719>"5"))

but it returns a value of 0 which is incorrect.

What I need to do is have the formula return a sum of all of the fields in colG that are >5 within a date range. Once I find that # I have to divide it by another field and multiply by 100 to get the percent.

## Sumproduct Query: Count Number Of Days Holiday

Jun 29, 2009

I have a formula which I have copied from one of your good selves and tried to adapt it. The formula is below. I a am getting #NA as my answer.

=SUMPRODUCT(ISNUMBER(FIND({"h","H"},B11:G11))*{0.5,1})

I have a person name in Colomn A and then 1 week B-G on a row and want to count number of days holiday.

## Multiple Criteria Countif Or Sumproduct

Sep 16, 2009

I haven't been this deep into excel before. The deeper I look, the more potential I recognize, the more amazed I get. That being said, I have come to a tough count issue. Let me attempt to explain as precisely as possible.

My current worksheet is large but I am only particularly concerned with two columns of information (Regions) and (Days). The logic I am attempting is something along the lines of Count If Region = East, or West, and Days is greater than 0, less than 60.

I am open to any and all suggestions on how to tackle this situation. I have been able to achieve similar counts by using pivot tables but the dynamic nature of these two columns presents some difficulties that my “new user” mind has been unable to work through.

## Using Multiple Sum Ranges In Sumproduct() & Countif() In Array

Jul 2, 2009

My problem is :

1.In G Column I put logic for Fail and Obtained Marks.

G2=IF(COUNTIF(B2:F2,">=60")=5,SUM(B2:F2),"Fail")

2. Now in H column I want use this formula which I obtained from this forum

H2=SUMPRODUCT((G\$2:G\$7>G2)/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1

To get the position of Students.

But the text value "fail" in the G2:G7 getting Position No. 1 and i've noticed the reason by using evaluate formula as well.

3. I got solution by changing "Fail" with 0 by creating column I and then column H put this formula ........

## Countif Or Sumproduct Function (count In A Range)

May 6, 2009

I am trying to do a basic count in a range, however am a little brain fried and its not working. On attachment, column D is to list all times out of column A and B listing only unique entries (have tried to use Macro with advanced filter however not liking it being an extract). Column E is to be a count of how many times the break time in Column D appears.

## Adding Another Condition To Sumproduct (countif) Statement

Oct 6, 2011

I am using the formula below to count the occurences of relevant text strings (names) in a cell that can contain many separate strings. It works great. "References!\$F\$2:\$F\$34" contains my list of names and the formula returns how many occurences there are in each cell.

What i'd like to do know is work in a date criteria. Each name has an associated relevant date attached to it as does each cell that I am looking for these names in.

So...in english what Id like to do is alter my formula so that when it finds a text string that exists in "References!\$F\$2:\$F\$34", it then compares the associated date in "References!\$G\$2:\$G\$34" with the date associated with N3 which happens to be O3.

SUMPRODUCT(COUNTIF(N3,"*"&References!\$F\$2:\$F\$34&"*"))

## Using Multipel Sum Ranges In Sumproduct() & Countif In Array

Jul 6, 2009

I want to get students positions in a class like 1st, 2nd, 3rd, etc. There can be two 1st position and 2 2nd positions at a time .

1.In G Column I put logic for Fail and Obtained Marks.
G2=IF(COUNTIF(B2:F2,">=60")=5,SUM(B2:F2),"Fail")
2. Then i made array formula in column H to get the position
={SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G2))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1}
Some improvement to write fail & position
={IF(COUNTIF(B3:F3,">=60")5,"Fail",SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G3))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1)}
And more work to get total marks & position and Fail at the same time......
={IF(COUNTIF(B2:F2,">=60")5,"Fail",SUM(B2:F2)&"-"&SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G2))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1)}
Now I wounder that is there a way to do all calculations in column H without using column G

By replacing (if there is any method) G2, G3, G4 etc. with Sum(B2:F2); Sum(B3:F3);Sum(B4:F4) etc. in below formula
={SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G2))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1}.....................

## Index/Match From Sumproduct/Countif Result

Feb 27, 2010

I am using this to count how many times a particular number appears across numerous sheets, My sheets are in a Named Range MySheets....

=SUMPRODUCT(COUNTIF(INDIRECT("'"&MySheets&"'!A2:A30"),A2))

This works great.
What I now need to do is to find ALL matches and return B1 from those sheets..

GHIJKLM1Countif ResultFirst ResultSecond ResultThird ResultFourth ResultFifth ResultSixth Result25AppleBananaPearMangoOrange31Banana43BananaMangoOrange

I have played around and the closest I can get is with this...

=IF(COUNTIF(INDIRECT("'"&MySheets&"'!A2:A30"),\$A2),INDIRECT("'"&MySheets&"'!B1"))

This as you may know only returns the result B1 from the first sheet within MySheets.

## Combine SUMPRODUCT, SUMIF, COUNTIF Within Date Range

Jan 13, 2007

The attached spreadsheet has a "master" workesheet in which I enter customer info, salesperson info, and date. The totals spreadsheet automatically calculates number of sales, contact value.

I need to modify the following formulas to only calculate the data within a date range shown in 2 cells.

=COUNTIF(Master!A1:A176,PayPeriod!A4)
=SUMPRODUCT(--(Master!A1:A176=Totals!A4),(Master!K1:K176))
=E4SUMPRODUCT(--(Master!A1:A176=Totals!A4),(Master!K1:K176))

## 2003: COUNTIF/SUMPRODUCT, Multiple Criteria W/Wildcard

Nov 24, 2008

I'm trying to write this but it returns a 0 when I know there are 3 records that match this criteria: =SUMPRODUCT(('Invoice-Detail'!J2:J50="NewJob_Post.NET")*('Invoice-Detail'!H2:H50="KY_*")). I think the problem is in the wildcard character. I don't know if I should be using COUNTIF or SUMPRODUCT or something else?

## Sumproduct OR Adding Criteria To Countif, Counta And Average

Feb 21, 2010

I trying to convert the following formula (I, II, III) and add criteria of Name and Date to the count values of “c”

CURRENT FORMULA

I: “=COUNTIF(C2:C3100,"

## Pass Parameter From Excel Through MS Query To MS Access Query

Nov 26, 2012

I have an MS Access query that contains a parameter. The parameter is a date field, and I have configured that in the Access query. If I run the query within the MS Access user interface, it prompts me for the paramater value as expected, and runs just fine. However, I want to connect to this query from within Excel as a data source.

I have created a connection to the Access file using ODBC from within Excel. In the MS Query window, I am merely selecting all of the fields resident in the MS Access query, and returning all values. In other words, there is no selection criteria in the MS Query. I have done this many times with Access queries that DO NOT contain a parameter, and everything works fine. However, in this instance, I need to pass a parameter through to MS Access in order for the query to run. At the moment, I get the "Too Few Paramaters...1 expected" error message. This makes sense, because I haven't figured out how to pass the paramater to MS Access.

Is there a way to structure this that does not involve VB code? If so, I'd love to know how. I have tried creating parameters in MS-Query with the same name, but although I get the prompt it doesn't connect with the Access query as the source for the parameter value.

If the solution requires using code, I'm good with VB Code in Excel...is there VB for Excel code that could make this happen?

Failing that, I guess there must be (I've seen a few in my search thus far) Access VB Code that can make this work. I'm very rusty using VB with Access, so this is my least favored solution. However, if this is the only option, keep in mind that I need to pass the paramater ultimately from a user who will initiate the process using Excel.

## Query Parameters Which Takes The Date From The Cell Into The Query

Mar 29, 2007

Need the query parameters which takes the date from the cell into the query. How should I modify my query if it needs to take the date from a cell?? The bold one date should be picked from one of the cell in sheet 2.

My query is this
WEB
1
http://fc-web-phl1-101.phl1:8090/gp/...runReport.y=12

Selection=15
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False

## Create An Conection With MS QUERY To A Csv And Query Data

Sep 6, 2008

I have a csv file on another drive on the network that i need to query. I believe that ms query would be the best way. I know that a DSN needs to be setup but this macro will be used by various users who wont know how to do that. thus I would like to create one via VBA every time the task needs to be run.
I haven't a clue how to do this and i need it to be explained to me in general terms with words of one syllable!

## Query An Access Query With VBA Function

Jul 8, 2008

I'm trying to query a query in Access 2003, from Excel 2003.

The query in Access looks like:
AccessQuery: [SELECT VBAFunction(field1) FROM Table]

The query in Excel looks like:
ExcelQuery: [SELECT * FROM AccessQuery]

I use the following VBA code in Excel to excecute the query:

With ThisWorkbook.Worksheets(cDataSheetName).QueryTables.Add(Connection:=strConnection, _
Destination:=ThisWorkbook.Worksheets(cDataSheetName).Range("A1"), Sql:=strQuery)
.RowNumbers = True
.Refresh BackgroundQuery:=False
iResultRowCount = .ResultRange.Rows.Count
End With
When I execute this code I get the error message 'SQL Syntax Error' (Error 1004). When I remove the VBA function from the query in Access, it all works fine.

## Edit Query Using Query Wizard

Apr 25, 2006

I created an Ms Excel Database Query to bring in data from MS Access. (versions 2002 of MS Excel and Ms Access). The query works fine initially. I can right click, choose Edit Query and change my criteria. Results are returned almost instantly.

My problem is that, once I save the workbook, or autosave happens, I get an error when I right-click to Edit Query: This query cannot be edited by the Query Wizard..

## MS Query - Parameters (parameters On A Query But Use A Wildcard To Return All Instances)

Nov 17, 2009

Is it possible to set parameters on a query but use a wildcard to return all instances? I have a query that I want to be able to set multiple parameters on but give the user the ability to select as many or as few parameters as they want to see. 2 of the parameters are number fields and 2 are text fields with no spaces.

## COUNTIF (b4:b65000= &quot;Name&quot; Then Countif G4:g6500=&quot;BI&quot;)

Apr 21, 2009

I have a simple database spread sheet and I need to count a column under certain conditions. In one column I have employee names that appear repeatedly, in another I have codes. I want to be able to count how many times the code appears next to the name.

For instance:
If b4:b65000 = Sam Douglas then I want to count how many times different codes appear in the adjacent cell.

Sam Douglas:BI
Sam Douglas:BI
Sam Douglas:SI
Sam Douglas:BI

BI = 3
SI = 1

## Web Query

Mar 24, 2009

i import a table from the internet through web query and i reformat the cells to suit my liking, but when i refresh the data the cell formatting goes back to how it started. how do i make it so it always keeps that same cell formatting?

## Query

Jul 19, 2006

Is it possible to open microsoft query without opening Excel or Query Wizerd.

## Web Query A Pdf?

Feb 17, 2007

Is it possible to use the Web Query function in Excel on a PDF file?

## Access Query

Dec 8, 2008

I'm trying to build a query which matches two tables which say has a number like A#### , I want the query to give me the A number's which do not belong in the second table but which do in the first table. i believe i need an SQL query to do this?

## Ranking Query

Apr 30, 2009

I have a spreadsheet which we use to rank scores for our golf society.

At the start of our season it was decided that if anyone of the top 3 scores were tied we would separate them using a second criteria(back nine score). Any scores from position 4 down would still be tied.

From searching this forum i have managed to separate ties using the 'back nine' second criteria(using a hidden helper column) but only for all the ranking positions not just the top 3.

I have attached the file.

## Re-using Query Names

Oct 18, 2009

how I would be able to weed out and remove previous references to query names.

For example if I have an external data query named "qry1 by week", then remove the query, then create another one, how do I use the same query name again? Surely there's a reference to it somewhere, that I can eliminate?

Copyrights 2005-15 www.BigResource.com, All rights reserved