How to make Vlookup ignore blank cells while still checking to see if the ones with a value inside are correct - database

I am currently making a tardy counter system for my principal as of right now I am having issues with trying to make it so that whenever a new entry is put into the Datasheet it references to the ID sheet and checks to see if it's correct and if it is the cell next to it is blank if it is incorrect it should say error but every time when I try =IF(A2:A="","",ARRAYFORMULA(if(VLOOKUP(A2:A, ID!A1:A,1,FALSE)=A2:A, "", "error")))
it correctly checks but if any are wrong it outputs N/A I'm fine with that on the ones with a value in it but I need to get rid of the "N/A" corresponding to the blank cells
in summary, I need it to count the values that don't match the ID sheet as wrong rather than the blank cells as wrong
I tried multiple if functions but had no good results
also here is a copy

try:
=ARRAYFORMULA(IF(A2:A="","",IFNA(IF(VLOOKUP(A2:A,ID!A:A,1,)=A2:A,),"error")))

Have you tried the ISBLANK() function. Ex. IF(ISBLANK($A2),...
I got this working in google sheets, try it out:
=IF(isblank($A2),"", IF(IFERROR(VLOOKUP($A2, ID!A:A,1,FALSE)=$A2), "", "error"))

Related

Indirect and Concatenate #ref error on *open* workbook

I've been trying to find the answer to this, and the only results I'm getting are #ref errors on closed workbooks. I'm getting this error when the workbook I am referencing is open.
So here's what I'm doing - I'm trying to blend numbers daily from different banks from multiple worksheets with multiple tabs each. Since those worksheets have a date followed by a random ID number, we're going to just rename them to a set name (eg, "pmac") and dump each into a folder. Then, we'd open each one we want to blend, and I'll use "ISERROR" to turn any reference errors to blank so only the open workbooks are included in the blend (which I'll try to add as soon as I can get this indirect reference to work).
The team that would be using this is on a shared drive, so I decided to make some dynamic fields "RatesheetFolder" and "PennyMacFileName", so if we ever needed to move or rename stuff, we'd change it in one place instead of updating every formula.
So currently, my formula looks like this:
=INDIRECT(CONCATENATE("='"&RatesheetFolder&"["&PennyMacFileName&"]Conventional'!B"&ROW(B17)))
but it returns a #REF error. Everything I'm reading is saying that it's because the workbook is closed... but it isn't. It's open. If I copy and paste the value from the formula above into a cell, then THAT reference works... so the concatenation wasn't done incorrectly either, but for some reason it won't reference the open workbook.
I also tried doing the same thing, but on a local directory, in case the shared drive was an issue... same problem though. (for reference, here is the pasted value of the above formula)
='C:\Users\username\Documents\Reports\In Progress\[pmac.xlsx]Conventional'!B17
I also tried leaving out the folder path entirely, since I'd be dealing with open workbooks, and that also didn't work (copy/pasting values of the concatenated string still works, so again, it's not that it's written incorrectly). Also tried having both files in the same folder, no luck.
Any idea what's going on? Is it some kind of security thing that my company might be blocking the indirect reference or something? Maybe the way I'm using the row function?
I am using Office 2016.
Additional:
So, boiling things down to their absolute minimum....
=$B$2 returns the value in B2
=CONCATENATE("="&ADDRESS(2,2)) returns the text "=$B$2"
=INDIRECT("=$B$2") returns a #ref error
=INDIRECT("$B$2") returns the value in B2 (so only without the "=")
=INDIRECT(CONCATENATE("="&ADDRESS(2,2))) returns a ref error
=INDIRECT(CONCATENATE(ADDRESS(2,2))) returns the value in B2
Thinking it was the equals sign causing the trouble, I tried this:
=[pmac.xlsx]Conventional!B17 which returned the value from the other workbook
=INDIRECT([pmac.xlsx]Conventional!B17) still returns a ref error...
so I'm lost again.
I tried the last two things again, but with the full directory path (not just filename) and same thing - actually writing the direct reference out worked
='C:\Users\username\Documents\Reports\In Progress\[pmac.xlsx]Conventional'!B17
but the indirect reference didn't
=INDIRECT('C:\Users\username\Documents\Reports\In Progress\[pmac.xlsx]Conventional'!B17
Oddly - when I did the Indirect formula with the full path and hit enter it removed the full path and changed it back to just the filename (since the workbook was open):
=INDIRECT([pmac.xlsx]Conventional!B17)
but it still threw up a reference error. So it recognizes the workbook and that it's open... but it still gives an error trying to reference it. The indirect-concatenate does seem to work when I'm not referencing another workbook, so it does seem that's where the issue is... but I don't know why.
So I guess I found the answer after messing around with quotation marks and stuff in both the indirect formula and the concatenate formula.
To start, I realized that INDIRECT(B2) gave a ref error, while INDIRECT("B2") worked. So I went back through and tested a few things out making sure concatenate returned the exact right thing, and then surrounded that with an indirect formula.
So when I did =INDIRECT([pmac.xlsx]Conventional!B17) this didn't work because it wasn't a string. If I did =INDIRECT("[pmac.xlsx]Conventional!B17"), THEN it worked. Indirect requires it to be a string.
Looks like the problem was that Concatenate returned [pmac.xlsx]Conventional!B17 as text - but when I copy/pasted the VALUE that the concatenate formula returned, that then reverted the string back to a value, and stopped working inside the indirect formula.
What ended up working (and I swear I tried this already....) was:
=INDIRECT(CONCATENATE("'"&RatesheetFolder&"["&PennyMacFileName&"]Conventional'!B"&ROW($A17)))
I must have accidentally removed the single quote mark before RatesheetFolder when I removed the equal sign causing it to fail, and then every attempt after that was me trying to break it down into the individual parts, and unknowingly undoing the "string" property that concatenate applied whenever I pasted the result it into the indirect formula.
TL;DR of what I figured out
The Indirect formula requires it's contents to all be text/string
The results of Concatenate are returned as text/string, making additional quotation marks around those results redundant and cause an error
If you're referencing a cell directly, you need the equal sign
=B2, but if you're doing an indirect reference, you want to leave
the equals sign out of the indirect formula =INDIRECT("B2")
So putting that all together (in this example DynamicVar's value is simply the letter B) :
=INDIRECT("B2") works
=INDIRECT(B2) doesn't work
=CONCATENATE(DynamicVar & 2) returns B2 without quotations, but it's a string, so..
=INDIRECT(CONCATENATE(DynamicVar & 2)) works

Passing null values in sendKeys()

I am reading data from excel sheet and passing those values into the application using sendKeys(). But when I am trying to pass any null values using sendKeys(), I am getting "org.openqa.selenium.WebDriverException: unknown error: keys should be a string" error. Please help me, how can I pass null values using sendKeys().
You don't send nulls
As mentioned in the comments, a user cannot send a null via their keyboard, so Selenium won't do it either.
Instead, you should be doing some sort of filtering when reading in values from an external source (a good practice even beyond dealing with nulls).
In your filter, if the cell field is blank (null), then you should do one of two things:
Send nothing
Send an empty string; ""
Actually, you should have filters for both. There will be times you don't want to send anything and there will be times where you want to send "" to blank out the current value.
I personally have it set up so if the cell is blank, send "", and if the cell says "null", then don't send any values.

Using CONCATENATE in a MATCH Function

So I'm creating a Hyperlink that will go to a specific Tab. There are multiple tabs.
=HYPERLINK(CONCATENATE("#","'",G3,"'","!E")&MATCH(E3,CONCATENATE("'",G3,"'","!E:E"), FALSE),"GO")
The first CONCATENATE works, but the 2nd one in the MATCH function returns "'G3'!E:E" and results in a #VALUE! error.
The reason I need it to go to G3 is that's the Tab Name I want it to go to. Different lines will go to different tabs and I'm trying to make it automatically populate with the Tab Name.
Help! And Thanks in Advance!
~Michelle
Though HyperLink accepts a string, MATCH does not. So you need to use INDIRECT in the MATCH to turn the string into a viable range reference:
=HYPERLINK(CONCATENATE("#","'",G3,"'","!E")&MATCH(E3,INDIRECT(CONCATENATE("'",G3,"'","!E:E")), 0),"GO")

Google Spreadsheet array not working

I'm not sure what I missed as my arrays are not working. Here's the link:
https://docs.google.com/spreadsheets/d/1_pPSRjEnKv10mDR8LICVvVv7jgXVBJ1aWZ8KrdEIKd4/edit#gid=0
Please check highlighted in green.
Thanks
Im not sure how to explain why it doesn't work because there are a list of things - various ways in which array formula operates - but I would like to suggest to you to use regexextract instead of search: I created the two formulas for is profile and is live, hopefully I can try to explain what the pieces do:
in column Y:
=arrayformula(if(arrayformula(if(istext(regexextract(C2:C,"automated")),1,0))+arrayformula(if(or(istext(regexextract(C2:C,"clinic profile")),istext(regexextract(C2:C,"dr profile"))),1,0))=2,1,0))
in column Z:
=arrayformula(if(Y2:Y=1,if(istext(regexextract(C2:C,"live")),1,0),0))
Basically instead of using the search - regexextract will find your search terms anywhere in that text and it works well with array formula, then using the if and istext to give it a true of false value of 1 or 0.
if the value is not found in that corresponding cell, it would in theory return #N/A if it was in an individual cell - but if the value is there the regexextract would return that value to you, which why the istext works
By the way if Im confusing you , then if you want to change your sheet to be editable by anyone I can jump in and show you what I did..

creating a character array with gff file

Could someone please help me with creating a "character array" with this sort of data:
ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Escherichia_coli_ATCC_8739_uid58783/NC_010468.gff
Instruction from our collaborator:
One can copy and paste a gff file into a character array by typing gff={} and then copy and “paste excel data”
But I can somehow only save it as a cell array and hence the script downstream can't run properly.
additional info
I need to use the .gff file in a .m script (that I got from someone else) to parse my sequences.
Here's the part of my script that I think pertains to my question:
genelist=gff(:,3);
starts=gff(:,4);
ends=gff(:,5);
names=gff(:,9);
genelogical=strncmp('gene',genelist,4);
Therefore I want 9 columns with information like this:
1. seqID;
2. source;
3. type;
4&5. start and end;
6. score;
7. strand;
8. phase
9. attributes
Also when I saved the cell array as "cell", and tried to convert it into a character array by typing
char(cell)
I got this error message:
cell elements must be character arrays
So guess that doesn't work...
edit over
Anyone has any idea?
Thanks,
Joyce
The instructions you were given are referring to the following context menu item accessible from the "Variables" editor:
First, run at the command line gff={}; to make an empty cell array. Then double click the gff variable in the Workspace tab to get the above editor window. Click on the square regino to the top left of the table to select all cells, then right click to get the displayed menu, and paste the data. You should end up with the following if the paste worked correctly (it could actually take a couple of minutes - check CPU usage):
Then the commands you posted work. The strncmp says definitively that as cell array is needed.

Resources