Sum IF (2 Equal Values)
Oct 19, 2008
I've created the following function that chooses the maximum value from a set of cells then inserts theappropriate row number (within a table) into a new cell.
=IF(J27=0,"?",IF(J27=J19,1,IF(J27=J20,2,IF(J27=J21,3,IF(J27=J22,4,IF(J27=J23,5,IF(J27=J24,6,IF(J27=J 25,7,IF(J27=J26,8)))))))))
It's working fine until I have 2 cells with the highest value. The above statement is entering the first cell that meets the criteria in the new cell but ignores the fact there maybe 2 (or more) of the same value.
How can I get both (or all) to be entered in the same cell? Is there a better way, maybe highlighting all the rows in the table that equal the max figure?
View 6 Replies
ADVERTISEMENT
Jul 5, 2007
I'm having trouble with a small vba macro. At the end of the macro I test to see if two variables are equal and then print out true or false. However, for some reason even though the variables are equal vba is not treating them that way. I have put the values that represent the variables on a spreadsheet and used the if(x1=x2) formula and it says it is true, also, when I debug the macro and watch the values when it comes to test the logical expression the numbers are the same. I don't understand why vba does not say that the two variables are equal. I have attached a screenshot of the breakpoint where I double check the values are equal.
View 2 Replies
View Related
Jun 19, 2014
One aspect of my Excel-based project involves comparing the operator-entered part number (in Excel) to a predetermined list of part numbers in one column of an Access database table. Right now, my program is telling me that every part number entered in the spreadsheet (50+) does not match any part number in the database, which I've verified to be incorrect. I've checked that both the spreadsheet part number and the database part number are of the string datatype.
To the best of my knowledge, my looping logic seems valid and robust. To the best of my knowledge, there are no hidden characters in either the database cells or in the spreadsheet cells causing this apparent mismatch. I'm completely stumped at this point as to why my program doesn't detect any matches between the spreadsheet and the database table. Below is the Sub containing the code for checking that the part numbers match:
[Code] ....
This issue seems to be a hybrid issue between Excel and Access with (to me) more of the issue on the Access end.
View 11 Replies
View Related
Aug 21, 2008
Trying to find the sum of all cells in the array described in the formula that are equal to the values inside the quotations. I used this exact (as far as I can tell) formula to find the sum of values that were NOT equal to my quoted values and it worked just fine. Any ideas why formula 'A' will not work but formula 'B' does work? I have a feeling I'm missing something simple here!
Formula A - Does not work:
=SUMPRODUCT(--('Master Lead Sheet'!$J$2:$J$10000=$B2),--('Master Lead Sheet'!$N$2:$N$10000="REJECTED"),--('Master Lead Sheet'!$N$2:$N$10000="CONDITIONED"),--('Master Lead Sheet'!$N$2:$N$10000="APPROVED"))
Formla B - Works:
=SUMPRODUCT(--('Master Lead Sheet'!$J$2:$J$10000=$B2),--('Master Lead Sheet'!$N$2:$N$10000"No Answer"),--('Master Lead Sheet'!$N$2:$N$10000"Disconnected"),--('Master Lead Sheet'!$N$2:$N$10000"Wrong Number"),--('Master Lead Sheet'!$N$2:$N$10000"EMAILED"),--('Master Lead Sheet'!$N$2:$N$10000"needs to be emailed"),--('Master Lead Sheet'!$N$2:$N$10000"Refund"),--('Master Lead Sheet'!$N$2:$N$10000"REFUNDED"))
View 9 Replies
View Related
Dec 5, 2012
I have a spreadsheet that has a number of values and a separate sheet that has a paid total. What would be the easiest way to find the values in sheet 1 that total the sum in sheet 2? There may be more than one possible solution as to the items that total the sum.
View 1 Replies
View Related
Jul 3, 2014
I'm trying to sum all values greater than 5,000,00 and less than or equal to 10,000,000. I have this formula:
Code:
=SUMIFS(B6:B1359,B6:B1359,">"&L2,B6:B1359,"=
View 5 Replies
View Related
Aug 23, 2008
how to set all values in an array to be the same value. Currently I am using code in a For/Next loop like the following to do this:
Sub testing()
Dim ArrayToAllHaveSameValues(1 To 30) As String, i As Integer
For i = 1 To 30
ArrayToAllHaveSameValues(i) = "Value"
Next i
End Sub
View 7 Replies
View Related
Aug 26, 2006
am currently setting up a fantasy football league.
i have set up the league, with team name overall points and position, my problem is that when 2 teams have the same points one team is omitted and the other team has its name on both entries
the formula's i am using are
vlookup = to find the name of team for the points
large = to find out points of each team
View 6 Replies
View Related
Jun 3, 2014
I have a table full of phone numbers and call durations.
In A2:A6160, I have 162 different phone numbers and in U2:U6160, I have the call durations for calls made to those numbers.
In a separate spreadsheet, I have each number listed in Column A and in Column D, I want to display the average call duration for each of the numbers.
View 3 Replies
View Related
Dec 2, 2009
How can I count the number of cells in a range that contain values that are greater than or equal to zero?
View 2 Replies
View Related
Jan 14, 2014
I have a workbook with 2 sheets - [Names] has with a list of Staff Ids column B, [Access] has a list of their system acces - with their staff ids in column A and access in F (There could be more than 1 type of access),
I am looking to create a code that :
For each ID in [Names] B lookup in [Access] A
if found create a string with value in F ( so I have a list of all access )
And paste into F in [Names]
I have tried all sorts of things and just can't get it working.
View 5 Replies
View Related
Feb 27, 2014
Is it possible to separate a range of cells with numerical values into "n" groups that have equal (or as close to equal as possible) total sums?
Ex. The range A1:A30 includes 30 random numbers between 1 and 12 (obviously there are duplicates). I need excel to auto-generate 6 groups of 5 cells each with each group having the same (again, as close as possible) total sum. Preferably, I'd like the numbers in each group to be similar from top to bottom, but I'm not overly concerned about that.
View 2 Replies
View Related
Dec 24, 2008
I need to group all records where the values in column A are equal. BUT I needed them sorted by another column (the whole sheet, not just within each group). Currently, all of the values in column A are listed in random order. Is there any way to do this manually?
to elaborate a bit further, consider the following:
Columns: A-B-C-etc.
1-Z...
1-X...
4-X
3-Y
4-Y
2-Z
Basically, I need to group all of the "1"'s and all of the "4"'s so that the extra values will show underneath the other. HOWEVER, I need them to be sorted such that the order in which they appear are XYZ. So the goal would be:
1-X
1-Z
4-X
4-Y
3-Y
2-Z
View 9 Replies
View Related
May 2, 2014
I have cells that they're values should be equal B6=B11, B7=B12, B8=B13, E6=B14, E7=B15, E8=B16, I want a macro that if the values are not equal then the background should be RED and a pop up message "The values should be equal".
View 9 Replies
View Related
Feb 21, 2009
how to apply this code to include specifically these ranges in pairs: H50 & H51, H102 & H103, H154 & H155, and H206 & H207.
'tried to cut and paste the code from Private Sub to End Sub changing only
the Ranges (see above), but it didn't work.
View 14 Replies
View Related
Sep 10, 2012
Say I have Column A populated with Employee Names, and Column B populated with "Pass" or "Fail" (which indicates a passed or failed customer service call monitoring).
For each employee, I want to be able to look at all of their overall scores (usually between 3 and 10 evaluations per month) and easily highlight people who have failed 2 out of 3 consecutive evaluations.
I want to integrate this feature in to a weekly quality report.
View 1 Replies
View Related
Mar 31, 2008
I have a spreadsheeet with values in columns F:K from row 10 onwards
I need VBA code that will delete the rows where there are values opposite and equal in columns F:K from row 10 owards for eg if F10 is 10000 and K10 is -10000, F 25 is 150000 and G25 is -10000, G29 is -175000 and H29 is 175000, then rowa 10,25 & 29 must be deleted
View 9 Replies
View Related
Mar 10, 2014
I need to distribute a list of data into 10 even groups of data. Here is the scenario.
I have 10 salespeople on my team with a list of accounts that need to be evenly distributed based on two criteria
- Each sales person needs to have the same number of zipcodes , with the closest TOTAL # of accounts and TOTAL $ value as possible
View 6 Replies
View Related
Jun 11, 2014
Need a Macro to delete all rows containing values less than or equal 300 in column A
View 5 Replies
View Related
Apr 20, 2012
(Excel 2007) The issue I'm having is that a loop statement of mine is failing to recognize that a couple values are equal. It works for the first 3 iterations of the loop, then stops recognizing. I tried copying another set of numbers in the failing one's place, and that actually worked. I can't attach anything, so I'm including a link to a detailed screen shot with some notes on it and code that I'll host on my site. Not sure how else to explain the issue, but if you take a look at the screen shot you can see the excel sheet being worked on and the vba code running. I will also include a text file of the code
Here are the links to the screen shot and text file of my code
Text file
Screen Shot
View 3 Replies
View Related
Jan 6, 2009
I have a simple sumif formula that says =SUMIF(W61:W112,"<30",J61:J112). In column W, there are values ranging from 0 to 5000. If the formula is written like it is above, it excludes summing values from column J when the cell in column W equals 0. Why is this? I can just add another function that says sumif "=0", but I don't think I should have to.
View 3 Replies
View Related
Apr 17, 2014
How to correct my formula because it does not work?
Here the formula: =COUNTIFS(Data!C2:C24005,A17,Data!M2:M11149,"<=0")
I need to insert the formula in column C (Findings tab) which counts the rows in Column M (tab named "Data") that equal A17 (Column A in "Findings" tab) and which are less or equal zero. In addition if I drag the formula down I want to only the values be entered in highlighted in blue cells in column C (SKUs With Zero Sales in "Findings" tab) and empty cells in not highlighted cells. I attached images of these two tabs: Data and Findings.
View 5 Replies
View Related
Apr 25, 2014
For column "B" count all the 1's if column header is equal to name in column A.
For Column "C" needs to be checked if a value was filled in column "I" if yes then check if in column "L" has a value, count all these values.
View 5 Replies
View Related
Jun 29, 2008
I'm trying to count if there are situations where column a is equal to a specific number and column b is equal to another number.
both columns are numbers. Does anybody have a good idea how to do this, maybe countif, but i am not sure how to do more than one item with that.
View 9 Replies
View Related
Mar 18, 2008
I have a quite complex list of variables to put into a formula to come up with the correct number and I need some help to figure this one out. I don't know if it would be easier to set up a chart and then index the chart to do a lookup or how I need to go about doing this to achieve the most efficent solution.
I need the following to go into one formula:
1. =< 24 needs to show the number 24
2. =< 30 but > 24 needs to show 30
3. =< 32 but > 30 needs to show 32
4. =< 36 but > 32 needs to show 36
5. =< 40 but > 36 needs to show 40
6. =< 48 but > 40 needs to show 48
7. =< 50 but > 48 needs to show 50
8. =< 60 but > 50 needs to show 60
9. => 60 needs to show 60
I am trying to set up a spread sheet to figure square footage of plastic laminate countertops, but the plastic laminate only comes in several stock sizes : 3x8, 4x8, 5x8
3x10, 4x10, 5x10
3x12, 4x12, 5x12
So if I have a countertop that is 25 sq ft., I cant use a 3x8 (24 sq. ft), so I need to go up to the next size which would be a 4 x 8.
I might need to use a ROUNDUP function with this formula too? I already have cells set up to figure the depth, backsplash height, and front edge height and then give me the squage footage of that.
View 14 Replies
View Related
Jan 4, 2014
Example If Selection.Value *Does not equal* ActiveCell.Offset (0,1) Then .....
View 1 Replies
View Related
Oct 31, 2009
I am trying to set a scorecard up where it will give points depending on the % actual. For example:
if less than 60%, then 0,
if equal to or greater than 60% but less than 75%, then 1
if equal to greater than 75% but less than 80%, then 2 and so on.
I have been playing around with the example below, but can't seem to get it working.
[php]=IF(A1<60%,0,IF(A1>A1<75%,1,))[php]
Maybe it 's because I pickled my brains last night.
View 4 Replies
View Related
Feb 12, 2009
revised this code to reflect the "not equal to". I want the user to only enter "In" or "Out." Therefore, If cells b19:B26 does not have either word, then the message box will prompt the user to enter the correct word again. I think my code needs to be revised into some kind of loop.
View 9 Replies
View Related
Jul 18, 2012
If/then statement:
Trying to say if C2 is equal to Fee, Fixed, then C2 should be equal to S2.
Was trying to use
=IF(c2=Fee, Fixed,c2=S2,C2)
but, don't think I have it quite.
View 2 Replies
View Related
Apr 24, 2013
I am confusing of using the equal function in vba, I need to have some cells between sheet1 and sheet to be equal but i cannot just put = sign in the sheet as it may be deleted. Can I have it as VBA code? how to do that and where to put this code, in what event?
View 3 Replies
View Related