# Sumproduct - Number Of Divers Logging Dives

Jan 24, 2014

Building a Dive Record spreadsheet and Annual Statisics requirements to compute automatically. I have gotten this far:

=SUMPRODUCT(((M\$10:\$M\$17="X")*(\$B\$10:\$B\$17<>"")/COUNTIF(\$B\$10:\$B\$17,\$B\$10:\$B\$17&"")))

Unfortuantely, I do not have a list of divers names for referencing. I am using these for testing purposes:

Column B Diver's Names: B. Dodson, L. Lloyd, D. Burch, C. Haley, J. Wilson, B.Dodson, B. Dodson Columns M through BO (types of dives): will have "X's" in them if a specific type of dive was made, Scientific, Working, Training, Non-duty... Shore, Boat, Ice, Cave, etc..

I need to know how many Divers made the type of dives. For example, if I make three dives in Saltwater, L. Lloyd makes one, and D. Burch make one, the answer needs to show 3 which is correct. If Dodson makes one, Haley makes one, and Wilson makes one, the number is 2 (actually 2.33). It works in some cases and not in others.

## Add Up Each School Grand Totals For All The Dives, And Break Them Down To Boy Or Girl For Each School

Jul 26, 2009

I ma going to have a couple of tricky (to me at least) table/range look ups, so let me start with this one:

.......a........b...................c.....................d....................e
1............Dive 1......................................School Grand Totals
2..team.....diver nr......... points...............Boys...............girls.
3 md b.......1..................3.....................md b...8..........md g...4
4 md b.......2..................3.....................jb b....7
3 jb b........3..................3................
6 md g,......4..................3
7
8..............Dive 2
9..team.....diver nr......... points...
10 md b.....1..................1...........
11 md b......2.................1...........
12 jb b......3.................4
13 md g......4................1

Notes about above. The naming is like this. "md b" is "martin county boys". "md g" would be "martin county girls". "jb b" is "jensen beach boys".

I need to add up each school grand totals for all the dives, and break them down to boy or girl for each school. this score will eventually go into another total which totals 11 swimming events by boys or girls.

So, in essense, thre are going to be several totals for the meet:
1 Diving (6 dives) by School by Boy (note: only showing 2 dives here)
2 Diving (6 dives) by School by Girl
3 Swimming, (11 events) by School by Girls
4 Swimming, (11 events) by School by Girls
5 Grand total by school (boys and girls scores combined)

Texaslynn (I believe that was her handle) helped me previously with totaling a grand total. However, now I discovered I need the total by boys and girls and then the combined (boys and girls) school total.

## Logging In A Website With Macros

Dec 12, 2008

I'm trying to automate some webscraping on a website that requires a login, and was wondering how I would do so using Macros with a specific username password somewhere in the spreadsheet, lets say B2, and C2 respectively. The website I'm trying to login is this; http://underground.chacha.com/account/. I think I have most of the scraping figured out; its just the log-in for now.

## Recording/Logging Cell Value When Value Changes

May 8, 2009

Is there a way to copy/transfer a cell value to an adjacent cell when the value of the cell changes. So if A1= 5, and it changes to 3, have B2 = 5 when this happens.

## Automated User Logging

Oct 1, 2009

I keep a spreadsheet with the 50 or so wireless phones in our "lab". When someone checks them out, the rules are that they change the cell under Available to "NO" and add their user ID. When they return the device, they change the Available cell back to "YES". What I want is a log of who checked out the device, and when... which would be kept in "sheet 2".

I attached a small spreadsheet with the same columns and information you would see in the regular spread sheet. Sorry, I would rather have put it here, but I couldn't figure out how to do that.

The spreadsheet has code which updates the "Counter" when someone checks out a device. Many thanks to the "Rocket Scientist" who helped me with that.

## Logging Changes To A Worksheet Range

Oct 29, 2009

i have a spreadsheet with the following range in a worksheet called "Data".
The range is A3:CH9 where column A contains the data label and row 3contains a label for each month. So the data itself is in B4:CH9

Is it possible to set a macro that logs any changes to the data in the range
B4:CH9 and log that change in another worksheet (eg: "Log"). It would say who made the change (based on the USERNAME), what cell was changed, when it was changed and what the value was changed from and to.

## Logging Live Data

Nov 30, 2008

I'd like to log live update data continuously,i.e. as the data in the cell changes. The problem I'm facing is that the data comes in at uneven intervals-- ranging from 30 to 50 ticks per second. So I can't really use a timer function. I need to use some function which saves the data as the cell value changes. So, for example, if cell A1 gets updated continuously, cell B1 could save the first value of A1 and then cell B2 could save the second value of cell A1-- and so forth.

## How To Restrict Users From Logging More Than Once In Excel

Nov 7, 2011

I am doing an excel survey using forms. I want to restrict users from completing the survey more than once. i am using below code to input user login details in to a spreadsheet but i am not sure how to restrict them. I want a msgbox or some sort and then it closes the excel active workbook.

Sub GetName
Dim r As Range
Set r = Sheets("UserNames").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)

r.Offset(0, 1).Value = Date
r.Offset(0, 2).Value = Time

End Sub

After looking through various forums i found code to highlight duplicates but not sure how this can be modified to suit my need.

Code to find duplicates:
Sub Dups()

Application.ScreenUpdating = False
Rng = Selection.Rows.Count

[Code] .......

## Self Destruct Workbook After Not Logging In Within 30 Days

May 20, 2007

I need a macro that records users accessing a workbook over a network and if I have not logged in after a 30 day period it will replace all calculations with data and if possible wipe all macros.
I have tried to nut this out but time is against me.

I have had my work taken to other sites within our business and passed of as their work, and it bugs me.

## Code Reuse - Logging Actions When A Cell Changes

Apr 28, 2009

I am trying to use following codes for a add-in utility so that user can enable or disable logging activity for a given workbook.

My problem is to how to add the following code to a new workbook so that "Loginfo" function could be activated. I have tried some application... based commands but it do not seem to be working.

## Code Reuse - Logging Actions When A Cell Changes -2

May 2, 2009

I have made an class and created a file to log when user change value or insert formula in a sheet get recorded in a file C:Logme.csv. The problem is it is recording the value and formula at random i.e in some instances it records the value and in some instances it is not recording the value and formula in logme.csv . I am unable to figure out why this is happening?

## SUMPRODUCT Use But With Unknown Number Of Rows?

Sep 15, 2012

I need to put a value on every line having "file:" in the second column. The value requested is a sum of the numbers in the forth column following this line until the next "file:" line.

I know it is not trivial, but sure it is possible.

57
file:
HIRES-~1
#VALUE!

58
208
1
1

[Code] ...........

## =sumproduct- Returning The Number Of Items

Feb 23, 2009

Im using the below formula -

=SUMPRODUCT(--(Jan!D9:D999 > 0)--(Jan!Y9:Y999="FALSE"))
But it keeps returning the number of items in JanD9:D999 > 0 , when i want the number of items in column Y which contain "FALSE" if D is greater than 0.

## Counting A Number In A Cell When Sumproduct

Apr 4, 2007

I have a spreadsheet with 3 coloumns. In A I enter Address, B Date, C Ward/District Area (this is a data validation list). At present I use; = SUMPRODUCT((HFRA!B4:B2000>=Summary!B1)*(HFRA!B4:B2000<=Summary!B2)). Summary B1 and B2 are dates to search between e.g 1/01/07 and 31/01/07. The above formula only counts the date enteries between B1 and B2.

I would like to change this so that it still checks that the date still falls between B1 and B2 but is adds together the numbers entered in coloum A. So coloumn A would become number of completed actions not an address.

## Sumproduct: Count Number Of Leaves Within A Specified Period

Nov 5, 2009

=SUMPRODUCT(SLVL!\$B\$6:\$B\$49>=\$A\$2)*(SLVL!\$B\$6:\$B\$49<=\$B\$2)*(SLVL!\$A\$6:\$A\$49=A12)

I'm sure that there had been an error somewhere but I can't figure it out. I'm getting zero value. Situation: need to count number of leaves within a specified period, thus I opted to use Sumproduct.

## Sumproduct :: Get A Number Of Entries That Fall Into Category

Oct 6, 2009

I'm trying to make my formula work. It is working now but I need to add one more criteria and I can' figure it out. I need to get a number of entries that fall into this categories:

John Smith09/02/2009Closed

=sumproduct(--(A1="John Smith"),--(B2>=Today()-90),--(C3="Closed"))

Now I need to get a count of entry either if there is a date >= Today()-90 or if it says "Closed" in C1. But I only need one of the two and I can' figure it out.

## Sumproduct With OR Logic - Count Number Of Rows In Dataset

Jan 17, 2014

I'm trying to count the number of rows in a dataset where column A is something, B is something, C is something, D is not something, D is not something else, and column E > 0 OR F is something but I just can't get the result I want.

My actual dataset is a staggering 294,000 rows and 46 columns so here's a simplified version:

## 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.

## Sumproduct: Determine The Number Of Unique Names In Column

Jan 22, 2010

I have 1500+customer names in column C7 of table. I'm looking for a SUMPRODUCT formula that achieves the following 2 logical goals. First, it needs to determine the number of unique names in column C7. It can't just count the rows because many customers appear multiple times in the range. So, I have been using the following formula and it works great:
=SUMPRODUCT(
((Table[C7]<>"")/COUNTIF(Table[C7],Table[C7]&"")))

Second, I'd like the formula to tell me how many of the unique names in C7 correspond to public companies. Column C8 of my table indicates whether or not a company is public ("Yes") or private ("No"). So, I've been using the following formula and it seems to deliver the right result:

=SUMPRODUCT(
((Table[C7]<>"")/COUNTIF(Table[C7],Table[C7]&""))
*
(COUNTIFS(Table[C7],Table[C7]&"",Table[C8],"Yes")>=1))

But the added COUNTIFS statement seems very unwieldy and indirect to me. Why do I have to examine every instance of a particular company's name when the answer could be determined by looking at any instance of the name -- after all, each company in C7 is either public or private, and has the same corresponding value in C8 (whether "Yes" or "No") everywhere that its name appears in C7!

So that's my first question: is there a clearer, more efficient way to achieve the same result? My second question has to do with toggling the public company test.
What if I create a special cell, say A1, that will always contain either the word "On" or "Off"........

## SUMPRODUCT With Multiple Criteria: Count The Number Of Documents

Nov 3, 2009

I have attached a spreadsheet with a small indicative data set to assist in understanding. I am trying to count the number of documents each individual has assigned to them that are not yet 'completed' (ie REGISTERED, IN WORK, REVIEWED). The problem I am trying to overcome is that the document state can be 1 of several values indicated in the same column.

I have tried using this SUMPRODUCT formula:
=SUMPRODUCT(((\$E\$2:\$E\$11="REGISTERED")+(\$E\$2:\$E\$11="IN WORK")+(\$E\$2:\$E\$11="REVIEWED")*(\$B\$2:\$B\$11="Jones")))
but it is generating incorrect values!

Specifically:
- Jones shoulld return 1
- Franks should return 3
- Smith shoudl return 0

## Sumproduct- To Get The Total Number Of Columns That Have A Specific Match-up

Aug 25, 2008

I've got two columns of numbers, such as:

(Col A) (Col B)
Cycle Bin
1 - - 3
1 - - 7
1 - - 7
1 - - 2
1 - - 5
2 - - 7
2 - - 9
2 - - 6
3 - - 7
3 - - 2
4 - - 2
4 - - 8
4 - - 2
4 - - 8
4 - - 5

I'm trying to get the total number of columns that have a specific match-up, for instance, how many cells are in Cycle 1 with Bin #7? ....

## SUMPRODUCT With 2 Criteria, But One Is A Maximum Number Of Items To Include

Jan 14, 2009

I have no problems figuring out SUMIF or SUMPRODUCT with multiple criteria, but I'm trying to help someone with an issue that the second criteria is actually not all-inclusive.

Column B - Lots of numbers, the SUM range
Column C - Yes and No flags. Y or N

C1 = maximum number of matching items to include.

So, =SUMPRODUCT((C2:C100="Y")*(B2:B100)) sums up ALL the Yes rows, but the guy wants to restrict it to the last X matches, and put that X factor in C1. So if C1=5, only the last 5 Y matches are included.

## Sumproduct And Max: Caclulate The Max Number Based On Two Colomns Criteria

May 5, 2006

i'm trying to caclulate the max number based on two colomns criteria. For example if column A equal MC1 and column B equal 1 then find the max value of that group. I tried using sumproduct but so far it only works if i have one criteria wasn't too sure how to use it for two criterias. See attached file

## Sumproduct (count The Number Of Unique, Or Distinct, Company Names In Column)

Jan 28, 2010

I want to count the number of unique, or distinct, company names in column [C7], subject to two conditions that will exclude certain unique company names from the count.

I should also point out that most company names appear multiple times in column [C7].

a) Count the unique company names in column [C7]...

b) ...including only those companies who have at least one "Yes" in column [C8] somewhere among their records

c) ...and who also have at least one value equal or greater than "1" in column [C15] somewhere among their records

Note that that there is no requirement that the "Yes" and the "1" ever appear in the same record.

## Incorrect Sumproduct Array: Sum Up The Total Number Of Hours Consumed On A Particular Activity Within A Specified Period

Oct 23, 2009

I am trying to sum up the total number of hours consumed on a particular activity within a specified period.

=SUMPRODUCT((\$C38:\$C176>=\$B7)*(\$C38:\$C176<=\$C7)*(\$B38:\$B176=\$D5))

Unfortunately, the formula above gives me the total number of activity and NOT the total number of hours within a specified period. I attached the file I'm working on as reference.

## SUMPRODUCT & Dynamic Range: Total All The Blank InDates For Each Technician By Employee Number

Feb 22, 2009

I have what I thought was going to be a simple function to create and, after a week of getting more error messages than I've had in a year, I'm ready to throw in the towel. Situation: There are two worksheets in the same workbook [Excel 2003]. One is for "Posting" details about technicians and their work orders. The other is a "Report" that summarizes the number of workorders open, closed, etc.

In the "Posting" sheet, I have created dynamic name ranges for two columns: Technician (4-digit text field) and InDate (date field that, if blank, means that the technician has not closed this work order. My ranges are set up like this:

Technician=OFFSET(Posting!\$B\$2,0,0,COUNT(Posting!\$B:\$B),1)
InDate=OFFSET(Posting!\$D\$2,0,0,COUNT(Posting!\$D:\$D),1)

So all I need to do is to total all the blank InDates for each Technician by employee number. I've tried COUNT to SUMPRODUCT. A co-worker got it to work with using...=SUMPRODUCT((ISBLANK(Posting!\$D\$2:\$D\$65307))*(Posting!\$B\$2:\$B\$65307=4288))
His solution was to list almost every available cell in each column. I just can't help but think that the dynamic name range should be able to work but I can't get it right. I think I'll choke if I get one more "N/A" or "VALUE! error.

## Excel 2007 :: Determining / Counting Number Of Values Used In SUMIF / SUMPRODUCT Function

Aug 2, 2014

I am using Office/Excel 2007 and Windows 8

I want to determine the number of values SUMIF/SUMPRODUCT functions used/checked to arrive at the answer, i.e. 95 for row 2 and 116 for row 3. A function that can give a 3 and 2 respectively.

Example:

Results for Row #2 gives: 95 with 3 values picked up under "Rate"

Results for Row #3 gives: 116 with 2 values though three places were checked up under "Rate"

How can I count the number of these values referencing at the "Rate" like in the functions used.

I managed to use SUMIF/SUMPRODUCT functions to calculate totals based on "Rate" in row one.

I tried COUNTIF function, but allows only field/heading.

A
B
C
D
E
F
G

[Code] ..........

results for each formula used

95 formula: =SUMIF(B\$1:G\$1,B\$1,B2:G2)

95 formula: =SUMPRODUCT((B\$1:G\$1=B\$1)*(B2:G2))

3 formula: =COUNTIF(B1:G2,B1)

## Multiple Criteria And SUMPRODUCT (count The Number Of Rows That Have Values Greater Than 10/01/2008 In Either Of Two Fields)

Jan 23, 2009

I am trying to count the number of rows that have values greater than 10/01/2008 in either of two fields. I tried following formula but instead of giving total number of rows, it returns a random date.

## If And Sumproduct Formulas: Calculate The Number Of Instances Of "CU"

Mar 30, 2009

I have a sheet that contains rows containing letter codes for example "CU". This is generated by an IF formula i.e. If true = "CU". However I need to be able to calculate the number of instances of "CU" but sumproduct will not work as it sees the cell as containing a formula not the result i.e. "CU". Sumproduct code:

## Sumproduct (get The Number Of People "Occupied", "Partly Occupied" And "Available" On A Monday, Tuesday Etc Of The Current Week)

Oct 22, 2009

I'm having issues with sumproduct. I can't seem to get the right info that I need. Attached is the file I'm working on. Problem: I need to get the number of people "Occupied", "Partly Occupied" and "Available" on a Monday, Tuesday etc of the current week. "Occupied" means an employee has more than 2 tasks (based on New and Active-To-Date status). "Partly Occupied" means an employee is working on 2 tasks.
"Available" means an employee has NO task at all.