I'm getting a #num error to a previously working formula.
Formula:
=LARGE(A19:A20,1)
FORMULA OUTPUT: #NUM!
A19: 3/20/2018
A20: 5/1/2018
I'm not sure why this isn't working anymore.
Regards,
If the data is Text and not true dates, use this array formula:
=LARGE(--(A19:A20),1)
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
NOTE:
This formula will work for both real dates and text that resemble dates. It is easy to see if the dates are real or not; just toggle Ctrl + `. Real dates will display their underlying numeric value, text date will remain unchanged.
Related
I have a table where I would like to know the most common value of every row, all the data is text.
expected result is column D in picture
Example in picture.
I have tried this formula but it doesnt work, i only get #Value error
=INDEX(P2:R2,TRANSPOSE(MODE.MULT(IF(ISTEXT(P2:R2),MATCH(P2:R2,P2:R2,0)))))
You can use following array formula:
=INDEX(A2:C2,MATCH(MAX(COUNTIF(A2:C2,A2:C2)),COUNTIF(A2:C2,A2:C2),0))
Array formula after editing is confirmed by pressing ctrl + shift + enter
MODE works on numeric data, so you can, for your example, use:
=CHAR(MODE(CODE(A2:C2)))
I wish to count the number of " #Div/0" occurrence in excel, where 1/0 results in "#Div/0" value in excel, may I know anyone has experience how to count the number of it?
Thanks.
You can use the ERROR.TYPE function.
For example, the following array-formula, will count the number of #DIV/0! errors in the range D1:D10.
=SUM(IFERROR(IF(ERROR.TYPE(D1:D10)=2,1,0),0))
An array formula must be entered by holding down ctrl + shift while hitting enter. If you do this correctly, Excel will place braces {...} around the formula seen in the formula bar.
Here is an example showing that #DIV/0, when entered as text, is not counted. Note the two changes in D9:D10. One was entered directly and became an error, the other was entered as a text string. Note also the formulas adjacent to D9:D10 indicating text vs error
Use COUNTIF. For example, if you wanted a count of #DIV/0! in the first 10 cells of column A you could use this:
=COUNTIF(A1:A10, "#DIV/0!")
I'm indexing a table that somehow has numbers stored as text, here is a fragment:
{0\0\0\0\"110"\950\0\0\0\"3485"\0\0\0\"950"\0\0\0\0\0\100}
When I try to use sumifs for this range, i get wrong values. Is there any way to fix this in formula without changing the data?
This is the exact formula I'm using:
=SUMIFS(INDEX(INDIRECT("'"&"P_"&$C$3&"'!B9:BC100");MATCH($D6;INDIRECT("'"&"P_"&$C$3&"'!BC9:BC100");0););INDIRECT("'"&"P_"&$C$3&"'!B1:BC1");L$1))
You cannot use SUMIFS but there's a work-around.
Something like:
So if you have data like above, enter this array formula:
=SUM(IF(INDIRECT("A3:A5")=A$2,VALUE(INDIRECT("B3:B5"))))
by pressing Ctrl + Shift + Enter.
300 is entered as Text but you still get the correct total for all items equal to A$2 which is A.
Note: My local separator is , (not ; as in your example) so don't be confused.
Also, above is just an example, I'll leave the actual adaptation of your formula to you. HTH.
If you have ranges with numbers stored as text a good way to deal with this is to multiply your cells by 1 as you use them. Example below. You need to leave out the curly braces and press Ctrl+Shift+Enter to enter the formula, which tells excel to individually multiply each number by 1 before summing them (in my example)
Therefore, you might try the following formula with your data
{=SUMIFS(INDEX(INDIRECT("'"&"P_"&$C$3&"'!B9:BC100")*1;MATCH($D6;INDIRECT("'"&"P_"&$C$3&"'!BC9:BC100")*1;0););INDIRECT("'"&"P_"&$C$3&"'!B1:BC1");L$1))}
Note: I haven't tested this formula, but I did test that this method works with INDIRECT()
I'm using excel 2010.
I need a formula that will return the highest value of a mixed variable.
Look up VFL will return VFL00151
A1 VFL00001
A2 VWS00004
A3 VSC00056
A4 VFL00151
A5 VCC10025
A6 VGH00122
I'm avoiding using macros.
Thanks
With Col_A referring to your range in column A, and the lookup value (VFL) in C1, the following array formula (entered by holding down ctrl-shift while hitting enter, the following formula will perform as you request:
=IF(MAX(N(ISNUMBER(SEARCH(C1,Col_A))))=0,"",INDEX(Col_A,MATCH(MAX(IF(ISNUMBER(SEARCH(C1,Col_A)),--MID(Col_A,4,99),0)),IF(ISNUMBER(SEARCH(C1,Col_A)),--MID(Col_A,4,99),0),0)))
Of course, this assumes all of your entries start with three letters, and then are followed by digits.
Also, using the same set-up and assumptions as Ron Rosenfeld, but also assuming you're using Excel 2007 or later, array formula**:
=IF(COUNTIF(Col_A,C1&"*")=0,"",INDEX(Col_A,MATCH(1,(LEFT(Col_A,3)=C1)*(0+MID(Col_A,4,99)=MAX(IFERROR(0+SUBSTITUTE(Col_A,C1,""),0))),0)))
Note also that this solution is case-sensitive whereas Ron Rosenfeld's is not.
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
=MAX(--MID(A1:A6,4,LEN(A1:A6)-3))
ctrl+shitf+enter when you've entered the formula, to create an array formula. This assumes that all of your numbers have the same form, of 3 letters, then your number.
The mid formula takes the numeric part, based on the pattern you've outlined above. If the pattern is not consistent, you've got less hope with a formula. Doing this as an array, does all of the cells in the range in one step, and returns an array of numbers. This can then be 'maxed'
Update. To take this a step further, and do a lookup on the same principle (without error handling):
=INDEX(A1:A6,MATCH(MAX(--MID(A1:A6,4,LEN(A1:A6)-3)),--MID(A1:A6,4,LEN(A1:A6)-3),0))
I have a column of dates in Excel, and there will always be only two dates in the column. I want a formula to return the date that exists most (so if 1/23/13 occurs 24 times and 1/24/13 occurs 72 times, I want the formula to return 1/24/13).
I used the MODE formula across the range, and this worked for a couple days in a row, but today it did not work. Upon further review, I realized the dates are really viewed by Excel as decimal numbers, and I imagine this is the problem.
I could get to what I need by inserting a new column and filling it with =TRUNC(cell) for all cells in the range, and then applying the MODE formula to the new column, but I'm hoping there might be a way to do it without introducing a new column or formulas. Is it possible to do something like =MODE(TRUNC(range))? That specific formula didn't work, but I'm hoping something similar will.
Yes, your suggested formula should work......but it's an "array formula" which means that you need to enter it with a specific key combination.
Paste the formula in the cell then press F2 key to select formula and then hold down CTRL + SHIFT keys and press ENTER. If done correctly that will place curly braces like { and } around the formula in the formula bar.
If you have any blanks in the range then the result may be skewed with
=MODE(TRUNC(range))
so you can change that to
=MODE(IF(range<>"",TRUNC(range)))