Why is my IF(AND) nesting generating incorrect results? - excel

this may be a fairly simple one but I have spent a significant amount of time troubleshooting my formula and cannot identify as to why it is not returning the desired result.
I am working with two columns of data (A and B) which reference deals that my team is working on. Column A denotes the team member who is allocated to said transaction, and column B states whether or not the transaction is currently live ("TRUE" or "FALSE"). I am looking to return the email address for said team member if the transaction is live ("TRUE"). There are three team members contained within the spreadsheet, so I am nesting several AND functions.
I have tried the following code:
=
IF(AND(A1="TRUE",B1="Name1"),"name1.lastname1#x.com",
IF(AND(A1="TRUE",B1="Name2"),"name2.lastname2#x.com",
IF(AND(A1="TRUE",B1="Name3"),"name3.lastname3#x.com",0)))
The formula is returning "0" for each value, despite some of them meeting the relevant conditions.
Any help would be massively appreciated.
Thank you,

Looks like you just mixed up the columns.
Swap B1 and A1 expressions.

Related

Returning list of projects that are assigned to a person

I’m creating a project management template and I’ve bumped into problem.
I need to return a list of projects to 1 cell assigned to a certain member in a given time period (does project falls in a period or not).
When retrieving project names that are assigned to certain person in a period there is a problem because the range of cells that contains information of enrolled members includes several codes in text form - XX, YZ etc. F:F. Cells that include information about code assembled from 3 columns(based on the type of engagement) that could contain same person several times, cells that in that 3 columns also could contain several codes.
Ive managed to make a formula that retrieves list of projects based on starting date H:H, and deadline I:I in 1 cell:
No luck though with implementing binding to certain members. I’ve tried using another IF cycle:
{=TEXTJOIN(“; “;TRUE;IF($H$3:$H$13<=D$19;IF($I$3:$I$13>=C$19;IF($F3:$F$13=“*XX*”;$A$3:$A$13;””);””);””))}
Result - empty cell
I’ve tried implementing VLOOKUP and COUNTIF but so far unsuccessfully
I would really appreciate any possible solutions or workarounds, thanks
I think you can use a filter function to get this. I used an example on this google sheet, but it should work exactly the same in Excel. Basically you want to textjoin an array which you filter by meeting multiple and statements (*) along with one OR condition (shown with pluses) over four columns.
Double check the columns and ranges, but I think this works.
=TEXTJOIN(";",TRUE,FILTER($A$3:$A$19,
($H$3:$H$19<=$D$19) * ($I$3:$I$19>=$C$19) * (
(isnumber(find($B20,$D$3:$D$19))+
(isnumber(find($B20,$E$3:$E$19)))+
(isnumber(find($B20,$F$3:$F$19)))+
(isnumber(find($B20,$G$3:$G$19))) ))))

Google Sheets - Group Users With >1 Attributes

I'm working with a data of submission results. Some of data points available: name of submitter, date of processing, and results (approve/reject).
Here is a sample dataset:
Data is sorted by (in this order):
Name of submitter
Submission time of each person, in ascending order (e.g. Andy's 2 entries: first row rejected, second row approved.)
My goal : identify people who has been rejected AND tried submitting again AND eventually got approved.
Or an alternative 'filtering' statement = anyone who has BOTH approved AND rejected submissions.
So when applied to the data sample above::
Both Andy and Evan meets the criteria, since they both have been rejected (could be 1x or >1x), but eventually got approved.
People who got approved in their first try (David), or rejected but never got approved (Bill, Chris), would not be included.
Currently I only could achieve that by eyeballing the dataset, just like one might do on a small dataset such as above. However, I work with 10k+ rows in the actual dataset.
I managed to remove people who only have a single entry (regardless of approved status) since people who meet my criteria would have at least 2 entries.
I used highlight duplicate formula to color the duplicates, sorted the data by cell color, then remove the single entries.
When applied to the sample data above, I got:
My question is: is there a formula that could help me separate the Bills (multiple rejects) from Andys and Evans (people with 1 approve and at least 1 rejects) in a large dataset, without having to eyeball them?
Thank you so much for your help.
Thanks to #Solarmike, found a solution:
Use countifs to calculate the number of approve and rejects for each name.
Then filter out the ones with ApproveCount = 0.
Try below formula
=FILTER(UNIQUE(A2:A10),ArrayFormula(COUNTIFS(A2:A,UNIQUE(A2:A10),B2:B,"Reject")*(COUNTIFS(A2:A,UNIQUE(A2:A10),B2:B,"Approve"))>0))

IF function with multiple conditions

I've been trying to figure this out for the past two hours. I need to create a nested IF statement based on this info. Here's the question:
Incentive: A dollar amount which is based on a percentage discount of the house price as indicated on the Data section of the spreadsheet. It's given only to selected customers complying with any of these conditions:
The house located in New Jersey, zone 2 and is a multiple dwelling.
The house located in California, zone1.
The house located in Florida, single unit.
And here's an image of the Excel provided:
This is what I currently have:
=IF(OR((B10="New Jersey", C10="2", D10="Multiple"), (B10="California", C10="1")), ($B$4*E10), "No"
Any help is appreciated. Thanks in advance!
=IF(OR(AND(B10="New Jersey", --N(C10)=2, D10="Multiple"), AND(B10="California", --N(C10)="1"),AND(B10="Florida", D10="Single")), ($B$4*E10), "No")
You need to:
include a ANDstructure
get the right datatype for your C column (is it number, or is it text)
As previously stated, the error lies in your logic structure. Try the below formula:
=IFERROR(IF(OR(AND($B10="New Jersey",TEXT($C10,"#")=2,$D10="Multiple"),AND($B10="California",TEXT($C10,"#")=1),AND($B10="Florida",$D10="Single")),$B$4*$E10,"No"),"Error!")
We start with the OR function inside the IF function because we want to check if any of the following conditions are true. We follow that with three separate AND functions, each one testing your parameters. Should one of these AND functions return true for each statement within it, you will get $B$4*$E10 as your value; otherwise, we return No. I chose to wrap this all up in an IFERROR so that you can capture any potential errors (should they occur).
Also, I handled for the potential "number-formatted-as-text" issue by converting it to a number within the calculation.

Can excel clean up free-text user entry?

any help would be massively appreciated - I'm really stuck on this.
I have a field on a user entered form that asks people what university they've attended which, due to technical limitations on our system, has to be free text.
This invariably leads to hundreds of different entries for each university, which means I have to use filter on excel and comb through thousands of entries and manually unify - lack of knowledge on how to automate this limits it's practical use massively.
Does anyone know a way we can automate this process of categorizing (and then unifying) different entries which refer to the same thing (e.g someone might put UCL, another might put "university of college, London" and another "university of college london" - I need to teach the system that all 3 are the same and then convert it on excel).
I have a list of the exact entries we want for each university, and I'm happy to manually 'teach' excel when a user entry matches one of these, providing it then learns this for the future (so as time goes on, we have to less and less manual unifying).
Happy to clarify anything, and thanks so much for any help.
Rob
Don't become the victim of user mischief.
Assign a unique ID for each valid response and have the users enter the ID.
Yup...
As you said, you need to do some teaching, here's is the teaching table. Basically just fill up as you go along. You might ask what is UOL, sorry i just crack it out, just for illustration.
And then you have the users inputs (column E), plus 5 calculated columns (F:J)
And now the formulae, I'll show those in row 2 only, the rest are just filled down.
F2 = SUBSTITUTE(E:E," ","*")
G2 = VLOOKUP(E:E,A:B,2,0)
H2 = COUNTIF(A:A,F:F)
I2 = VLOOKUP(F:F,A:B,2,0)
J2 = IFERROR(G2,IF(H2=1,I2,IF(H2=0,"Never seen before","Need validation")))
Basically the logic flow is
do the exact match vlookup of user input in teaching table, if found, then thats it and return the unified name. (Column G)
if the above exact match not found, then we'll proceed to use the star like Helper vallue. Count how many times the HELPER value is found in the teaching table. (Column H)
do the exact match vlookup of helper value in teaching table. (Column I, for use with Column H)
If value in column G is not an error, then use it,
else if value in Column H is 1, then VLOOKUP(HELPER) value is good. If its 0, then you haven't teach excel on the name before. If >2, then it means it need your further attention, the VLOOKUP(Helper) value could be wrong as there are more than one matches.
The trick here is the HELPER column. by replacing blank space with stars, the vlookup now become some sort like vlookup of a sequence of keywords. Doesn't matter how the user's input is, as long as some keywords found and the sequence match, the countif and vlookup return the value.
And at the same time, you also submit an IT enhancement request ! :)

How do I fix this Query in my Google Document?

Could not really find much on this issue, and I even had my father, who works with excel all the time, walk away stumped on this one. Hoping you guys could shed some light!
Here is a copy of the document: https://docs.google.com/spreadsheets/d/1dH86E1hZRQMj3UL6n4B81IVEkHS5_djkXhHkOl3LOSE/edit?usp=sharing
So this was made for my Runescape clan for us to determine when users require a promotion; it simply makes things easier for us. I'm pulling the data with IMPORTHTML from a site that already tracks the data, my document just arranges it for our personal use (promotions).
On the right should be a list of just people that need the promotion, however, it seems whoever is first on the column I select with the QUERY (A2:D501, Pea being A2), they get put there regardless if they meet the criteria. In this case, under "General Promotions", they need a Clan XP of 250,000,000 and they must be a Captain rank (it goes Captain -> General), yet the Owner (both under 250m exp and not a Captain), is showing up there and under all categories.
Have no idea why this is happening, so if anyone could enlighten me, I would be greatly appreciative!
All I want is if there are no users who fit the criteria, I can have it say something like "No Promotions Yet". Couldn't figure that one out either.
Does this formula work as you want in cell F3:
=IFERROR(QUERY(A2:D501, "select A,B,D where D >= 250000000 and B contains 'Captain'"),"No Promotions Yet")
You will need to delete the formula you have in columns G & H though - QUERY can output multiple columns rather than needing a separate formula for each one.

Resources