If countIf formula error

drop05

Active Member
Joined
Mar 23, 2021
Messages
285
Office Version
  1. 365
Platform
  1. Windows
Hello I am trying to see why this formula is printing out and how i should edit it? If there word description or if it is blank on the first column it should bring up the error, but if there is not the word description or empty and has like i have other 1, then the second-third-fourth-fifth column should have a value for that row

But if it it does have "Description" it can have but the values have to be blank on the 2nd-5th column
i was using this formula
=IF((COUNTIF(D51:D70,"<>Description*")+20)<>COUNTIF(E51:H70,"<>"&""),"New Desc, no amount","OK")

i have this formula for the second column and works if i have other in the first column and a value in the second and third, but if i place a value in the 4th column it gives an error
=IF((COUNTIF(D51:D70,"<>Description*")+20)<>COUNTIF(E51:H70,"<>"&""),"New Desc, no amt","OK")

so to better explain, if it has the word description in column 1 (D) then the 2nd-5th (E-H) column should not have values, if it doesnt have the word description but has the word other or something then 2nd-5th (E-H) must have values if not it gives the "New Desc, no amt" if it meets the requirements then "OK"

1645741282659.png
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Ok, an image is difficult to see - see below for how to post a sheet here
anyway

=((COUNTIF(D51:D70,"<>Description*")+20))
This will count the number of cells that do not have a word starting with Description

And this
=COUNTIF(E51:H70,"<>"&"")
counts none blank cells in the range E51 to E70


so to better explain, if it has the word description in column 1 (D) then the 2nd-5th (E-H) column should not have values, if it doesnt have the word description but has the word other or something then 2nd-5th (E-H) must have values if not it gives the "New Desc, no amt" if it meets the requirements then "OK"

does this work , its a bit of clunky formula
=IF(D51="","",IF(OR(AND(((ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)>0),AND((NOT(ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)=0)),"OK","New Desc, No Amount"))
which would be OK

But its checking for the value of Description *
NOT(ISERROR(SEARCH("description*",D51,1)))
AND there is a NO value in E to F
SUM(E51:H51)=0)),
OR
NO Description
(ISERROR(SEARCH("description*",D51,1))))
AND
alue in E to F
SUM(E51:H51)>0
if either are TRUE , then OK
otherwise show "New Desc, No Amount"

If D does not contain any value - blank then leave blank
=IF(D51="","",


Not sure if you want just 1 entry to flag, this needs to be copied down to show the error

Various.xlsx
DEFGHIJKLMNOPQ
50DESC
511 FALSETRUETRUE
52description1New Desc, No AmountFALSEFALSEFALSE
53Name4OKFALSETRUETRUE
54DescriptionFredOKTRUEFALSETRUE
55 FALSEFALSEFALSE
56NameNew Desc, No AmountFALSEFALSEFALSE
57othername1OKFALSETRUETRUE
58New Name1OKFALSETRUETRUE
59 FALSEFALSEFALSE
60description xOKTRUEFALSETRUE
61
62
Sheet12
Cell Formulas
RangeFormula
O51:O60O51=AND((NOT(ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)=0)
P51:P60P51=AND(((ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)>0)
Q51:Q60Q51=OR(AND(((ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)>0),AND((NOT(ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)=0))
L51:L60L51=IF(D51="","",IF(OR(AND(((ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)>0),AND((NOT(ISERROR(SEARCH("description*",D51,1)))),SUM(E51:H51)=0)),"OK","New Desc, No Amount"))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,958
Messages
6,122,475
Members
449,087
Latest member
RExcelSearch

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