Counting TRUE for Values obtained from if function - excel-formula

I have applied if formula to display TRUE or False when condition is TRUE and false respectively. However, the count formula is unable to count the number of Trues obtained from the aforementioned formula even when I reference the cell with the value TRUE or use direct reference as "TRUE" in the formula. Can anyone tell me why this is happening and how to reference the value of TRUE to countif?

Related

Is there a way to SUMIFS with multiple criteria + true or false?

I want to sum the total value with its correct corresponding criteria and if the last condition will be true or false. If true, it will proceed to the sumifs, and if false "0" value. If there is no date, the value in each column will be zero
D9=SUMIFS(STORE!$C$6:$C$1000;STORE!$A$6:$A$1000;"*"&SUMMARY!$D$5&"*";STORE!$D$6:$D$1000;"*"&SUMMARY!$C$9&"*";STORE!$E$6:$E$1000;"*"&SUMMARY!D8&"*")
The question isn't so clear. Where are the criteria column or conditions in your excel? According to your current formula, if there is no date, all values should be zero. why are you using ""& &""?
As I understood maybe you can add as the last criteria
=SUMIFS(STORE!$C$6:$C$1000;STORE!$A$6:$A$1000;""&SUMMARY!$D$5&"";STORE!$D$6:$D$1000;""&SUMMARY!$C$9&"";STORE!$E$6:$E$1000;""&SUMMARY!D8&"";STORE!$AA$6:$AA$1000;TRUE)
STORE!$AA$6:$AA$1000: False or True column

Excel - check multiple true/false conditions

I have three cells which can either contain TRUE or FALSE. Then in another cell use a formula to check that only one cell contains true. If multiple of these cells are true, than I want to display an error message.
F4,G4 and H4 is where the values are written:
F4: True or False
G4: True or False
H4: True or False
Then in D4 I need to make my check. At the moment I can only figure out how to check if one of two fields contains true/true:
=IF(AND(F4=TRUE;G4=TRUE);"Only one true value allowed!";"Success!")
Is it possible to extend above function to check whether all three cells contains one TRUE value?
An alternative:
=SIGN(F4)+SIGN(G4)+SIGN(H4)=1
You can use countif to check how many cells contain True, and use an if statement to return a message depending on that value.
In cell D4 use this formula:
=IF(COUNTIF(F4:H4,"True")>1,"Only one true value allowed!","Success!")
As mentioned in the comments the formula would not chek for all three acounts being false, here is an update to the formula to correct the issue:
=IF(COUNTIF(F4:H4,"True")>1,"Only one true value allowed!",IF(COUNTIF(F4:H4,"True")<1,"Only one true value allowed!","Success!"))
And to add to that we can add a countblank to make sure all cells contain some data:
=IF(COUNTIF(F4:H4,"True")>1,"Only one true value allowed!",IF(COUNTIF(F4:H4,"True")<1,"Only one true value allowed!",IF(COUNTBLANK(F4:H4)>0,"Only one true value allowed!","Success!")))
further changes could be made to make sure only true or false are within each cell.

Extract value of formula based cell through if statement

I have a sheet where a cell D2 has a formula i.e.
=ISNUMBER(SEARCH("exception",$A2))
It returns TRUE or FALSE. Now i have another cell where it should return the heading of the column if it has TRUE in it. So I tried :
=IF(D2="TRUE","Unhandled Exception")
But as it returns FALSE whatever I do, I think its because D2 has a formula in it so it is not returning the value even if TRUE is present.
I came across the same problem yesterday.
Try changing your formula to
=IF(D2=TRUE,"Unhandled Exception")
Since the cell will have the value True, not the string "true"

Identify a subset of a range using TRUE statements

I am attempting to identify a subset of a range based on TRUE FALSE statements. An example is in the following chart below.
FALSE FALSE 1.21147
TRUE FALSE 1.20984
FALSE FALSE 1.21083
FALSE FALSE 1.210315
FALSE TRUE 1.21151
FALSE FALSE 1.21335
FALSE FALSE 1.213515
FALSE FALSE 1.212435
TRUE FALSE 1.212125
FALSE FALSE 1.21226
In this scenario I want a subset to be identified based on alternating TRUE statements. In the left side column the first TRUE statement would trigger the beginning of the subset an the TRUE statement in the second column would trigger the end of the subset. I then want to use a simple max function to identify the MAX in the third column. I would use an IF statement to determine whether or not the first TRUE statement is correct however, i am unable to figure out how to identify the subset of the range based on the TRUE statement in the second column. I also want to know whether or not this works from going from the top to the bottom if the statement could possible work going the bottom to the top. Any help would be most appreciated.
Part 1 can be done using a combination of MATCH, OFFSET and MAX
For this example I've assumed your data is located starting at cell A2.
For the sake of clarity I use some intermediate results in cells E1:E4. If you prefer a single formula, simply merge the intermediate formula into the final formula
Cell E2 = position of first TRUE in column A
=MATCH(TRUE,A2:A11,0)
Cell E3 = position of first TRUE in column B
=MATCH(TRUE,B2:B11,0)
Result formula, Max value in column C between the rows found in E2 and E3 (inclusive)
=MAX(OFFSET($C$1,E2,0,E3-E2+1,1))
Part 2 is more tricky: I don't think you can search up a range for a value. However, looking at your data it may be OK to search down for the second TRUE? If this is OK then:
Cell E4 = position of second TRUE in column A
=MATCH(TRUE,OFFSET(A2:A11,E2,0),0)
Or this, entered as an array formula (Insipred by Barry) which will get the last TRUE in the column
=MATCH(2, 1/(A2:A11=TRUE),1)
Result formula, Max value in column C between the rows found in E3 and E4 (inclusive)
=MAX(OFFSET($C$1,E3,0,E4+E2-E3+1,1))
your part about traversing the table from the bottom up confused me, and also don't know if you can have more than one subset, since you're penultimate row seems to be the opening of a new subset that is not closed. Anyway, hope that this helps. I'm assuming you don't want to use macros, in which case it would be trivial. What you can do is pad the top of the data set with an row that contains FALSE, FALSE, 0, 0, and add this formula to a fourth column starting with the first row of your set:
=IF(AND(NOT(A2),NOT(B2),OR(D1=0,AND(NOT(A1),B1))),0,C1)
That's assuming that your first row is row 2, and row 1 is used for the padding. A, B, and C are the three columns in your example, and D will print the value of the third column if it's within a subset, or zero if is not, so that you can easily calculate max() or whatever you want to do. I looks like this:

Using the Concatenate function in an IF statement

I am trying to find a string in excel cells, and it works to some extent, but when the value returns false I simply get "FALSE" in the cell, although when it returns a true value it actually changes the cell to what I have defined in the IF statement.
Is this because I have inserted the concatenate query incorrectly in the if statement?
My formula is as follows:
=IF(ISNUMBER(SEARCH(ET2:ET4,B2)),"yes",F2=CONCATENATE("NA ",B2))
The reason you get false is the bit that says
F2=CONCATENATE("NA ",B2)
I think you're trying to use this as an assignment (ie set the cell F2 to the value of the ConCat).
What it will actually do is compare the value of F2 and the value of the concat, and return TRUE if they are equal and FALSE otherwise. This TRUE or FALSE value is what you are ending up with in your cell.
So to fix it:
If the above formula is in the cell F2, then just remove the F2= from the formula and it should work.
If the above formula not in the cell F2, then you need to put either this same formula or a slightly altered one into that cell to populate F2.

Resources