I am writing a program that will use readtable to manipulate data that is read from an Excel spreadsheet such as the one below:
A B C D E F...
1 " " " " " "
2 " S 3 K3 " "
3 " " " " " "
4 " " 10 3C " "
5 " G 7 U " "
6 " " " " " "
.
.
.
I must extract the original location of some of the data, that is I need to store the location of 'S' as 'B2' and 'K3' as 'D2' etc. after they are read from the spreadsheet. To do this, I use readtableand then search for the location in the spreadsheet that contains the desired string; however, this requires that the entire spreadsheet be loaded into MATLAB.
I don't know in advance the number of empty rows or columns before 'S', nor do I know if some data will be filled in any of the columns in the rows above it. Additionally, I don't want the variable names to be generated automatically.
readtable('FilePath', 'ReadVariableNames', false, 'Range', 'myrange')
allows for not reading the variable names but doesn't allow for a dynamic range, i.e. the default option will skip the blank space and a specified range can't be dynamic.
opts=detectImportOptions('FilePath');
opts.DataRange='A1'
readtable('FilePath', opts, 'ReadVariableNames', false)
allows for specifying a start of the range but opts=detectImportOptions overwrites the 'ReadVariableNames' option, and the program reads the variable names anyway. The only workaround that I found was to use readtable without opts and to specify a range larger than the largest anticipated data set and then to trim empty rows and columns, but this is slow and clumsy. Is there a workaround?
If SNR text exists it gets values of AD6. If it doesn’t exist it get values of AD6.
If SR exists, it gets value of AA1
I am able to get this working with =IF(ISERR(SEARCH("SNR "," " & Sheet1!$D6& " ")),Sheet1!AD6,AD6)
However I cannot seem to include SR.
=IF(ISERR(SEARCH("SNR "," " & Sheet1!$D6& " ")),Sheet1!AD6,AD6) AND IF(ISERR(SEARCH("SR "," " & Sheet1!$D6& " ")),Sheet1!AA1,AA1)
Is there a way around this issue or is this a limitation of excel?
I have included an image to more accurately convey what I am saying.
I have a formula below:
=ISNUMBER(SEARCH("Perso",$A2))
I want to it return True for the field that exactly contains my key word "Perso"
However, from the image you can see that both rows return True, because the word "person" also contains "perso".
Can anyone provide some suggestions on how can I achieve my goal in Excel.
Include the deliminating space:
=ISNUMBER(SEARCH(" Perso "," " & $A2 & " "))
Title pretty much says it all.
I have multiple dependent drop down lists (A2:H2)
Each time you select something, a corresponding number is entered into I2, with the numbers being separated by commas.
However, you MUST select a value from each drop down list or else you get #N/A error.
How can I make excel just "skip" or "ignore" missing values?
Thank you!
P.s.
I have already tried the IFERROR and IFNA commands but they do not work. I either get "TRUE" , with no numbers at all. And I also don't know how to make this work for about 6 different vlookups.
UPD:
=VLOOKUP(A8,'New Categories'!A$3:B19,2,FALSE) &", " &
VLOOKUP(B8,'New Categories'!A$3:B206,2,FALSE) &", "&
VLOOKUP(D8,'New Categories'!A$72:B$83,2,FALSE)&", "&
VLOOKUP(E8,'New Categories'!$A$72:B$83,2,FALSE)&", "&
VLOOKUP(F8,'New Categories'!$A$59:B$68,2,FALSE)&", "&
VLOOKUP(G8,'New Categories'!$A$59:B$68,2,FALSE)&", "&
VLOOKUP(H8,'New Categories'!$A$59:B$68,2,FALSE)
Use this one:
=IFERROR(VLOOKUP(A8,'New Categories'!A$3:B19,2,FALSE), "") &
IFERROR(", " & VLOOKUP(B8,'New Categories'!A$3:B206,2,FALSE), "") &
IFERROR(", " & VLOOKUP(D8,'New Categories'!A$72:B$83,2,FALSE), "") &
IFERROR(", " & VLOOKUP(E8,'New Categories'!$A$72:B$83,2,FALSE), "") &
IFERROR(", " & VLOOKUP(F8,'New Categories'!$A$59:B$68,2,FALSE), "") &
IFERROR(", " & VLOOKUP(G8,'New Categories'!$A$59:B$68,2,FALSE), "") &
IFERROR(", " & VLOOKUP(H8,'New Categories'!$A$59:B$68,2,FALSE),"")
I am using the following formula:
If {USAGE.CURFY} = 0
then ""
else {USAGE.CURFY} & " (" & ({USAGE.CURFY_DAYSREMAINING} *
{USAGE.USEDPERDAY})+{USAGE.CURFY} & ")"
I am having difficulty displaying the formula with the numbers as whole numbers. I keep getting decimals with two places. I can make it appear as round numbers using File, Options, Fields, Number... but when I upload it to our Crystal Server, the two decimal places show again.
So, I am under the impression that I need to round within the formula.
USEDPERDAY and CURFY_DAYSREMAINING are fields with decimal values. CURFY is a whole number.
You need to convert the numbers to strings:
if {USAGE.CURFY} = 0 then ""
else totext({USAGE.CURFY},0)
& " (" & totext({USAGE.CURFY_DAYSREMAINING} * {USAGE.USEDPERDAY} + {USAGE.CURFY},0) & ")"
The second parameter to totext() specifies the number of decimals.