IF SUMPRODUCT COUNTIFF are giving me the wrong answer

lmcc007

New Member
Joined
Sep 9, 2018
Messages
35
A dummy/newbie needs some help.

My code is not working properly. After manually checking, I see that my code is not working. I can’t figure out what’s wrong.

I am trying to do the following:

1. I am looking at C1:F10 for duplicate numbers.

2. If the cells have one of the following numbers, do not count them—just ignore them:

4, 6, 15, 19, 25, 27, 30, and 33​

3. I am looking for duplicates that appear three or more times.

4. If three or more duplicates are found, put “Hot,” and if not put “NH”


Code:
=IF(SUMPRODUCT(COUNTIFS($C1:$F10,"<>4",$C1:$F10,"<>6",$C1:$F10,"<>15",$C1:$F10,"<>19",$C1:$F10,"<>25",$C1:$F10,"<>27",$C1:$F10,"<>30",$C1:$F10,"<>33")-2)>0, "Hot", "NH")

Thanks!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Control+shift+enter: Press down the control and the shift keys at the same time while you hit the enter key. When done successfully, Excel itself puts a pair of { and } around the formula in recognition.

Do I have to hit C+S+E all the time? Will it do it automatically.

Also, the answer is not correct. I need it to check to see if a number like 7, 9... appeared 3 or more times in the range. Then if so, put "hot"....
 
Upvote 0
Okay, I info on the Web about =Max(Frequency(IF....



{=MAX(FREQUENCY(IF(C5:H5>0,COLUMN(C5:H5)),IF(C5:H5=0,COLUMN(C5:H5))))}



Note: this is an array formula and must be entered with Control + Shift + Enter.


How this formula works


This is a tricky formula to understand, so buckle up!

This is way out my range of understanding.
 
Upvote 0
Last edited:
Upvote 0
The calm after the storm :)
When you strike Ctrl+Shift+Enter the {} are placed and it converts the formula to an array formula, you only have to do this once only IF you edit the formula.
Once it's there you can drag it down and it works.
ONLY AFTER EDITTING

Google for array formulays, one like that comes up
https://support.office.com/en-us/ar...-formula-e43e12e0-afc6-4a12-bc7f-48361075954d

I did the C+S+E and it worked, but the answer is still different from my manual answer.

Thanks, I have looked up array formulas, SumProduct, Max... a few times already but I am still lost. I can't find any examples like what I am doing. And, of course, I maybe asking the wrong questions since I am new at this. I know I have spent way too much time on this.

Okay, I have gotten off tract somehow. I have confused myself.


  1. I have six columns (A-F)
  2. C10:F10 is the row I want to compare against the previous 10 rows of number. I am looking to see if any of the numbers in C10:F10 have repeated three or more times in the previous 10 rows (C10:F10).
  3. If any of the numbers in C10:F10 have repeated three or more times, put “Hot” and “NH” if they have not.
  4. Also, I do not want to include the following numbers when checking for repeats: 4, 6, 15, 19, 25, 27, 30, and 33.

When I do it pen to paper it is simple--i.e., looking at previous 10 numbers to current 4 numbers, and so on.
 
Upvote 0
Wat you write down try and translate it to vba respecting the vba syntax because that is all it really is, that’s also the way I explain VBA
 
Upvote 0

Forum statistics

Threads
1,214,853
Messages
6,121,935
Members
449,056
Latest member
denissimo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top