Ignore #N/A when using Unique formula - excel-formula

I am using the formula below to return unique roles from a table column. This works fine until toward the bottom when i get #N/A's. I have tried both =IFNA & =IFERROR but still get them.
{=IFNA(UNIQUE(HrsRoleEchoPay[E-Source Role]),"")}

Sounds like you want to FILTER() your result, e.g.
=LET(u,UNIQUE(HrsRoleEchoPay[E-Source Role],FILTER(u,ISTEXT(u)))

Related

How do I use index match to find the first sale that a customer has made?

I have a table:
and I want to find the first order date for each customer.
For this, I have created a new column of customers and deleted the duplicates and tried using the function:
=MIN(IF($A$2:$A$74686=L2,$I2:$I74688))
But it doesn't seem to do what I want it to as the cells get larger.
I feel like I have to use an index match with the min function but I am unsure how to approach this.
As per my comment, it seems that in your current formula:
You are using ranges that are different in dimensions
You are using absolute references wrongly (in case you need to drag down)
So the correct formula would be:
=MIN(IF(A$2:A$74688=L2,I$2:I$74688))
Don't forget to enter through CtrlShiftEnter

How to use INDIRECT with INDEX-MATCH in EXCEL

The formula
=INDEX(tblWeek1[Area],MATCH($P6,tblWeek1[Leader],0))
is working correctly where $P6 is a leader name and an Area for that leader is returned.
However, I want to replace the table names with the value from a cell that will contain a chosen table name (I have multiple table for different weeks). But,
=INDEX(INDIRECT("A1"&"[Area]"),MATCH($P6,(INDIRECT("A1")&"[Leader]"),0))
Does not work where A1 contains "tblWeek1", even though
=INDIRECT("A1")&"[Area]" by itself correctly returns:
"tblWeek1[Area]"
Thoughts?
Thanks.
Try following formula.
=INDEX(INDIRECT(A1 & "[Area]"),MATCH(G3,INDIRECT(A1 & "[Leader]"),0))

VLOOKUP is malfunctioning in Excel?

I have been working on this issue for over two hours and I am beginning to question my sanity. I have used vlookup many times in the past, but now it is just not working as expected. I am trying to replicate a LEFT-JOIN (from SQL) in Excel using vlookup.
Here is the formula I am using on cell G2:
Here is the table of all the values I want to lookup values for.
Here is the table I am using as a reference:
I am only searching one column to simplify the example. Cell G2 contains the formula which is applied to the cells under it as well. As you can see from the first image, not only is it not matching but there is some pretty weird behavior going on.
I have removed duplicates for both tables.
I have unformatted the data to plain text values
I have tried this formula on three different computers
Regardless, I keep kept getting the same result! I am starting to lose sanity.
Does anyone have any idea?
Thank you
If you want exact matches, you should be using FALSE as the last parameter
The lookup table must be sorted in ascending order. Cell A369 appears to have a value lower than the row before it, A368. There are several instances of "lower" values occurring after a higher value.
Before you go insane, consider sorting the range $A$368 thru $A$679, and see if that makes a difference.
Otherwise, time to ditch VLOOKUP, and use instead INDEX and MATCH.
Sometimes you can get the #N/A error if your lookup_value isn't "clean". If that's the case, try this formula:
=VLOOKUP(TRIM(CLEAN(A2)),$A$368:$A$697,1,FALSE)
Additionally, your table_array may have "unclean" data, so you'll need to scrub that first before you're able to find a match. To do that, use this array formula, committing it with Ctrl + Shift + Enter:
=VLOOKUP(A2,TRIM(CLEAN($A$368:$A$697)),1,FALSE)
Have you tried doing a MATCH? does it need to be VLOOKUP?
if you are happy using match try:
=IF(MATCH(A2,$A$368:$A$697,0),A2,"NO MATCH")

Index Match Works on some cells, not others

I was using this Index Match formula with no issues:
=INDEX('Rain Data For 9 Stations'!A:S,MATCH(RainWICSProximity!J100,'Rain Data For 9 Stations'!A:A,0),INDEX($N$4:$N$12,MATCH(H100,$M$4:$M$12,0)))
I added more data, and it now only returns some values, while returning #N/A for others, even though there is a value to return.
Index returns the value in a range.
What you are doing is =INDEX(MATCH(),INDEX(MATCH())). It works due to some luck, because sometimes the second Index() returns cell with value as well. However, if the second index returns cell with an empty value, then the first index has to return something like =Index(4,0), which is #N/A.
In general, try =Index(Match(),Match()).
To see where exactly the error is, select the cell with the formula, go to the Excel ribbon >Formulas>Evaluate Formula.
Then press a few times Evaluate Formula and see what happens:
See this answer for step-by-step formula evaluation.
#Vityata was correct, Index, Match, Match works wonderfully, also, my original formula does work.
The issue was, I had calculate set to Manual, not auto, in excel settings.
I believe you need to expand your range. I am not real familiar with Index Match but trying to learn to use it more, but I believe it is kind of like VLOOKUP. Your ranges $N$4:$N$12 and $M$4:$M$12 is where it is looking right? If so, those ranges are not expanding even though you added more data. So you need to expand it to like $M$4:$M$100 or whatever. Or expand it to find the last row which is what I usually do. like mine would be "$M$4:$M" & LastRow & "" or something like that.

How to use COUNTIF in Excel that is dependent on two conditionals?

The first formula below is the one that operates correctly – its function is to tally up all “x’s” in a particular column when another column in that row says “Spain” and another column in that row says “Issued”.
=COUNTIFS(L$3:L$89,"=x",$A$3:$A$89,"=Spain",$H$3:$H$89,"=Issued")
The problem is with this next formula where I want it to do the same as above, plus add to it the tally for other rows that have “France”, for example. I know this formula isn’t structured correctly because the output is “zero”, when it should be “2”.
There are more countries that I want to add to this command eventually, but if I could get it to operate correctly with just two countries, adding the others should be easy. I’m not sure if the formula is the problem, or if I’m using the wrong function command, or what.
=COUNTIFS(K$3:K$89,"=x",$A$3:$A$89,"=Spain",$H$3:$H$89,"=Issued",K$3:K$89,"=x",$A$3:$A$89,"=France",$H$3:$H$89,"=Issued")
 
Something like this:
Entered using Ctrl+Shift+Enter

Resources