VBA function for excel 2010 to find number in string - excel

I am using excel 2010 and do not have the GetNumeric function available.
I need to get the string from "A1:A200" and put just the numeric value in "B2:B200"
I have tried to use the "Sumproduct but not had much luck.
Thank you for taking the time to check out my question.

For an Excel formula you can use this:
=SUM(MID(0&A2,LARGE(INDEX(ISNUMBER(--MID(A2,ROW($1:$99),1))*ROW($1:$99),),ROW($1:$99))+1,1)*10^ROW($1:$99)/10)
I copied the formula from this website, which also provides other options for returning only a numeric value from a cell.

Related

Dynamically extract a list of unique values from a column range in Excel?

I found this example in an excel tutorial
The following image is my desired result. and the following formula is supposed to be able to extract the unique records dynamically. I know how to do this with VBA but i really want to make this a formula without using a macro.
=IFERROR(INDEX($B$2:$B$9, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$9), 0)),"")
I have tried the above formula as given in the example link above but it returns with error. I am assuming that this worked at some point in excel however it no longer works with Excel 2016. Can someone clarify why this formula no longer works? Thank you.
Answering my own question about 5 minutes later, so i read the patch nodes on the how match changed from excel 2008 to 2016. You need to use the index rather than the count.
=IFERROR(INDEX($B$2:$B$9, MATCH(0,INDEX(COUNTIF($D$1:D1,$B$2:$B$9),0,0),0)),"0)),"")")
Recommended edit to the formula to change the value returned on error to a blank:
=IFERROR(INDEX($B$2:$B$9, MATCH(0,INDEX(COUNTIF($D$1:D1,$B$2:$B$9),0,0),0)),"")

Text instead of integer in Excel formula

I just received an Excel file from a colleague and I'm baffled by one of the formulas.
It's a Vlookup function where the column index number is equal to DTCN.
I tried looking up this formula but can't find it anywhere. Here it is:
=VLOOKUP($A15;KPI!$A$4:$AN$133;DTCN;FALSE)
What really matters:
=VLOOKUP(lookup value; table array; DTCN; range lookup)
I work in Excel 2010 and the formula works.
My question: What does DTCN do? How does it work? Can you only use in certain circumstances? ...
Thanks!
Take a look in :
Formula tab
Name Manager
you'll most probably find it there!

What is the purpose of new DAYS() function in Excel 2013?

I just found out that Excel 2013 has a DAYS() worksheet function. It appears to function exactly the same as subtracting one date from another.
One of the blogs I visited said that DAYS() permits you to work with text strings as dates, but I found that text strings also work with subtraction, as in:
="7/15/2016"-"7/1/2016"
which results in 14 when I enter it, which is the same result as
=DAYS("7/15/2016","7/1/2016")
Does anyone know what DAYS() will do that date subtraction will not?
Thanks!
Days can be more dynamic for example you could create a more complex formula with dynamic variables like this =DAYS(VLOOKUP(C3,C5:E16,3,FALSE),B3). In the example you sent it is more common for them to be static. Using the cells themselves can provide a similar function assuming they are in the same date and number formats. So an example using the same formula as above would be =VLOOKUP(C3,C5:E16,3,FALSE)-B3.

How to get sheet name using formula excel 2007

I am trying to get excel 2007 sheet name in a cell of that sheet using formula. I tried to Google and found this:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
But that does not work for excel 2007.
CELL("filename";A1)
Works but it gets the whole path.
My question is is there a way to get only a sheet name?
You can use the following formula:
=RIGHT(CELL("filename"),LEN(CELL("filename"))-FIND("]",CELL("filename")))
* Workbook must be saved first!
The formula is doing this:
RIGHT will return the characters after a numerical amount of characters in a string.
LEN returns the number of characters in a string.
FIND returns a number based on where a string is found within a string.
So all in all, the formula is saying take away the place that the first found ] is within the filename from the total length of the filename. We then just need the right hand portion of the filename after the numerical value we've just calculated.
You can "translate" 2010 formula to 2007:
=MID(CELL("filename";A1);FIND("]";CELL("filename";A1);1)+1;LEN(CELL("filename";A1)))
You may thing shorter way but that one works well.

SUMIFS source code for excel 2003 AND the ability to calculate on columns

we are looking to find the original? source code for SUMIFS to use in out excel sheet (for both 2003 and 2007. Here is why:
2003 doest support the SUMIFS method
When we do have SUMIFS we cannot utilize formulas "around" the columns (like YEAR())
For example, we want to calculate the ANSWERS that match the YEAR value of the date in cell A1 with the date values in range L:L. Now this doesnt work because we cant use YEAR(L:L) and hence we need to make another column M:M with the YEAR values from L:L
Thus we need the source to be able to upgrade the code further
=SUMIFS(ANSWERS;L:L;"="&YEAR(A1)) <= This works
=SUMIFS(ANSWERS;YEAR(L:L);"="&YEAR(A1)) <= This doesnt
Many thanks
With referenc to these questions:
Replacing SUMIFS in Excel 2003
VBA code for SUMIFS?
I doubt that you'll find the original code, which is, I imagine, C++ and part of the Excel internals. If that's correct, then it wouldn't help much, even if Microsoft gave it to you!
In general, I recommend against using =SUMIF(), =SUMIFS() and other functions that take a string to define the condition for testing: apart from anything else, I'm concerned that they're going to be slow, since my best guess is that internally they construct a string for evaluation for each value. In XL2007 (all I have available right now) at least, this turns out not to be necessarily true (see comments below).
I'm generally much happier with array functions. This, for example, should work in both Excel 2003 & 2007:
=SUMPRODUCT(--(YEAR(L:L)=YEAR(A1)),ANSWERS)
This gets the same answer:
{=SUM(IF(YEAR(L:L)=YEAR(A1),ANSWERS,0))}
In the latter case, you'd enter the formula without the curly braces ({ & }) and confirm it using Control+Shift+Enter to tell Excel it's an array formula.
In the first example, we build a list of boolean results with YEAR(L:L)=YEAR(A1) and convert it into an array of 1s and 0s using the double-negative. Then SUMPRODUCT takes care of the rest. This version requires that ANSWERS has the same dimension as L:L, i.e. it should be the entire column (or the range in L should be constrained in size).
In the second, Excel will run through each entry in L:L. If its year matches that in A1 then the corresponding ANSWERS value will be used, otherwise zero. This formula seems to be more tolerant of dimension differences but I'd still be careful.

Resources