Excel formula to search three ranges to determine value - excel

Essentially what I'm trying to do is create a formula that will search three different ranges to determine the value of a cell using true/false statements.
I6 needs to return a value of "Complete", "Partially complete", or "Not complete" and it will be searching three ranges J7:J10 (COMPLETE), J11:J14 (PARTIALLY COMPLETE), J15:J19 (NOT COMPLETE).
Each range will have questions I7, I8, I9 and so on where the options are YES or to keep the cell blank.
What I'm trying to achieve is that IF J7:10 are all true THENI6 will display COMPLETE however IF any of J11:J14 are true THEN I6 will display PARTIALLY COMPLETE and IF any of J15:19 (can be just one cell) is true THEN I6 will display NOT COMPLETE
I've tried using COUNTIF, IF, VLOOKUP, ARRAY but I keep getting the dreaded #NAME
Any ideas?

My understanding is the question in Columns I will be answered in Column J with either a "Yes" or leaving the cell blank. I highly recommend using Data Validation to limit unintended responses. Assuming my understanding is correct, you can solve this with nested IF statements and COUNTIF/COUNTBLANK statements. Excel will evaluate nested IFs from left to right, so you need to order these in importance of priority (e.g. what if someone has a "Yes" in both the Not Complete and Partially Complete section?). My suggestion would be:
=IF(COUNTIF(J15:J19,"Yes")>0,"NOT COMPLETE",IF(COUNTIF(J11:J14,"Yes")>0,"PARTIALLY COMPLETE",IF(COUNTBLANK(J7:J10)=0,"COMPLETE","THERE IS A DATA PROBLEM")))
This assumes that one "Yes" in the Not Complete section overrides anything else, and that the entire "Complete" section must be true to get a Completed result. Note that you'll get the Data Problem error if you have all blanks everywhere.

Related

Excel Sum if, critera range1 on a single cell

Title says it all pretty much, So in the image the sum looks for the first entry as it has "mr human" in the cell next to it but when i try to designate my critera range for a single cell i get #value returned, I can solve this by entering "mr human" into all the adjacent cells however to sheet I am pulling the data from has is formatted like It is shown so it would be ideal If i didnt have to make a copy then do that as this can be for several hundred "mr & Ms/miss"
Thanks for any help in advance!
First of all, I would say that you should indeed consider using a different model data for this, as suggested by #ScottCraner.
Second, this solution may work, but if you have a lot of sets (when i mean sets, i mean Mr Human, Miss Human, Kid Human, Grandp Human, and many more) it can be kind of annoying.
Now, first thing you must do is creating named ranges of each set of data. So the values related to Mr Human will be namedMR_HUMAN and values of Miss Human will be named MISS_HUMAN. It's easy to do.
Remember:
Names can't have blanks, spaces, or any weird char. Just use underscore.
Each name must be unique
Each name must contain 2 columns: first one is Code and Second one Cost.
A video example (type the name and press ENTER
Now the formula for column C:
=IFERROR(VLOOKUP(B3;CHOOSE(MATCH($A$3;{"Mr Human";"Miss Human"};0);MR_HUMAN;MISS_HUMAN);2;FALSE);"Not found")
You can see below that if I change cell A3 to Miss Human, values change properly:
This is how the formula works:
MATCH($A$3;{"Mr Human";"Miss Human"};0) This will search the text in A3 into the array of sets and will return a number according to position. In this case, Mr Human=1 and Miss Human=2
CHOOSE(*number from step 1*;MR_HUMAN;MISS_HUMAN) We use the number obtained in step 1 to combine with function CHOOSE, which allows to select a result based on a list. So we can use this function to relate number 1 to name MR_HUMAN and number 2 to MISS_HUMAN and it will return our target range with right values.
VLOOKUP(B3;*name from step 2*;2;FALSE) We combine the range from previous step and use it as matrix of a normal VLOOKUP, that will search the CODE in first column, and will return the value from second one (COST)
We trap all above inside an IFERROR, just to avoid VLOOKUP returning an error (error in VLOOKUP means that CODE is not found in that range).
The big issue here is that if you got a lot of datasets for more values, besides Mr Human and Miss Human, you need to adjust the MATCH and CHOOSE part, and can be annoying.
Anyways, hope this helps a little bit.
VLOOKUP
function
IFERROR
function
MATCH
function
CHOOSE
function
Also, consider using a different data model and the resume data using Pivot Tables.

Double nested IF statement formula in Excel

Good morning,
I would like to set a multiple if statement in Excel.
In row 8 you can see the following formula, which gives an answer in column Q. The answer based on this nested formula is Yes or No.
In row 13 all the cells are empty. Because the nested formula has been dragged down it still shows "No".
I was trying to write some double nested IF statement for this, which could cover the situation when the cells are empty and the Q column can come empty as well as a result.
=IF(OR(M9=" ",OR(N9=" ",OR(O9=" ",OR(P9=" "(IF(OR(M9="No", OR(N9="No", OR(O9="No",OR(P9="No")))))),"Yes","No")," ")
Unfortunately, the formula is not working.
Is it a possibility to add up an additional condition for the nested IF statement in Excel?
Something like:
=IF(COUNTA(M2:P2),<YourFormula>,"")
Where <YourFormula> is a placeholder for whatever formula you are interested in when any value in M2:P2 has a value.
As #JvdV has noted in comment above, your latest formula in comment above is still checking for a space, not a null (empty) cell.
Writing " " will look for a cell that contains a space (someone has hit spacebar). Writing "" will check to see if a cell contains nothing, in other words check to see it is empty.
I also noticed the error in your re-write: You wrapped the logical test within the parenthesis for the COUNTA formula. This is your formula corrected:
=IF(COUNTA(M9:P9)=0,(OR(M9="No",OR(N9="No",OR(O9="No",OR(P9="No"))))),"")
However, each OR statement gives a TRUE or FALSE result and can handle multiple arguments, as indicated by #SolarMike so I think you could probably re-write your formula to as follows to get the same result, if I have understood your requirements correctly:
=IF(COUNTA(M9:P9)=0,IF(COUNTIF(M9:P9,"No")>0,"Yes","No"),"")

Nested Excel Formula Modification Question

I am trying to figure out whats wrong with a nested formula I created:
In the image you can see the three sections the formula is broken up into:
is grouping cells into buckets
is referencing a separate tab (city density scores) and selecting only if the value is less than or equal the value in that tab
is performing a lookup also referencing a separate tab, and pulling in that value as long as that condition is met.
There is a unique key linking all three tabs. If all three conditions/sections of the formula are met, the idea is to return the value "Select" and if not, "Don't Select."
When I ran this formula in excel I'm getting "Don't Select" for cells that meet all #1,#2,#3 criteria, trying to figure out what I am doing wrong.
This is the formula I created. I feel its a small change that I need to make:
=IF(AND(OR(AM6="1 to 3 Bucket",AM6="4 to 7 Bucket"),$BK6<='City Density Scores'!$H$6), IF((VLOOKUP(BI,'Rank Competition Vetting'!$A$7:$F$182,5,0))<33%,"Select","Don't Select"))
Your formula logic is a little off. The correct form is (replace BI6 with whatever the correct cell is)
=IF(AND(OR(AM6="1 to 3 Bucket", AM6="4 to 7 Bucket"), $BK6<='City Density Scores'!$H$6, VLOOKUP(BI6, 'Rank Competition Vetting'!$A$7:$F$182,5,0) < 33%), "Select", "Don't Select")
Lets break it down: you have 3 criteria, all of which must be true to return Select
You have
IF(AND(OR(#1a,#1b),#2), IF((#3,"Select","Don't Select"))
This will work if #1 and #2 are TRUE, and fail otherwise (returns FALSE) because you havn't specified a False clause for the outer IF.
You really want all 3 clauses in the AND term
IF(AND(OR(#1a,#1b),#2,#3),"Select","Don't Select")
Now, you say you still get a false negative for a case where you believe all 3 criteria are met. To me, this points to a data issue - perhaps some numbers formatted as text? In any case, using the Evaluate Formula tool will help. You say you are having trouble using it: the process is to
select a cell containing the formula, then activate the tool
press Evaluate button repeatedly
at each click the underlined part of the formula is evaluated.
read the Evaluation to see if it lines up with your expectation
Here's an example (of my formula) evaluated up to the point where the VLOOKUP is about to be processed

How to get the value of a cell which is next to a cell containing specific text in Excel

I have a sheet which has cells with the text "Test Result" and the cell next to "Test Result" contains either Pass or Fail. I want to count the number of Pass and Fail instances which are mentioned next to the cell containing "Test Result".
NOTE: The column which contains the Pass or Fail that I want to count, has other Pass/Fail instances as well. So, I want to get the Pass or Fail value which is ONLY next to the a cell containing text "Test Result".
You can use the COUNTIFS function to accomplish this. If your data was in columns A and B, this is how you would enter the formula:
=COUNTIFS(A:A,"Test Result",B:B,"Pass")
If your data is predictably structured, and you are only trying to return a single result- I would go with #Scott Craner's answer of using VLookup or Index/Match.
If your data is predictably structured, and you want to count across many results, you should probably be considering using 2 sumifs functions (one for pass and one for fail).
If your data is not predictably structured, you can consider using an array of these sumifs functions to each check a particular column against its offset column, or you can accomplish this using VBA, but it's hard for me to suggest the exact code without seeing how the data is structured/unstructured. (Your explanation of the sheet and data layout is a bit vague)

Logical Statement Added to Formula

I need a logical statement added to my current formula (that i received here) and i need an addition to it.
The example as shown below is me trying to receive the number 1 if there is more than one A in a row. the issue i ran into is that i need to have this remain blank IF a specific cell has any value. Here that cell is represented by the number 10 right before the formula.
I tried using ISBLANK but i only received a false or true statement. I still would like it to appear as a 1 if there are more than one A's in a line and blank if it is false with the addition of not counting it if there is a number in a specific cell.
I'm not sure whether I got Your problem right, but sounds like You could apply the AND() operation like:
IF(AND(COUNTIF(A115:BC116,"A")+COUNTIF(A115:BC116,"a")>2;BE116="");"1";"")
If BE116 is the Range of the cell which shall be empty for counting.

Resources