I use a formula for copying data from sheet2 to sheet1 with this formula
=IFERROR(VLOOKUP($A1,Sheet2!$A:$B,COLUMN(),FALSE),"")
It works well. But It doesn't work with large text.
My text example:
http://www.imdb.com/offsite/?page-action=offsite-warnerbros&token=BCYjjcO9abopG7_2269JEn7520-r1f47KXvVIHfXH9dnHF2X3Dl07RaPqaEf8uh7ByYPH-tpY4mE%0D%0AFfjrAfF563s_sY8adxepid38SNgmJgrgRHMj5Oc0ffeB2tQe6wuVo68X5BQTu6B5uGGeMdQWKvZM%0D%0AelqFAg7XgXLNFluju2rwoseKKst4rCNtHlnnjk7a4PSCCKR6CPNEEvA45VGl1fdOJ5qThsifWItR%0D%0AefPnChuWEX4%0D%0A&ref_=tt_pdt_ofs_offsite_1
Applying #barry's solution to what I am guessing is where and what you want, maybe:
=IFERROR(INDEX(Sheet2!B:B,MATCH(TRUE,INDEX(Sheet2!A:A=A1,0),0)),"")
Related
I am a beginner to the Excel formula Please help to build the excel formula to sum the values in the rows (Z13:AC13) and from the result classify the value based on the below Classifications.
Unlikely: >=4<6
Possible: >=6<9
Likely: >=9<12
Certain: >=12<=16
I tried the below code but it is not working:
=IF(OR(SUM(Z13:AC13)>=4,SUM(Z13:AC13)<6),"Unlikely"),IF(OR(SUM(Z13:AC13)>=6,SUM(Z13:AC13)<9),"Possible"),IF(OR(SUM(Z13:AC13)>=9,SUM(Z13:AC13)<12),"Likely"),IF(OR(SUM(Z13:AC13)>=12,SUM(Z13:AC13)<=16),"Certain")
Try:
=CHOOSE(MATCH(SUM(Z13:AC13),{4,6,9,12}),"Unlikely","Possible","Likely","Certain")
Scott's answer is better, but if you'd rather have a more complicated formula that uses fewer Excel concepts, this worked for me:
=IF(AND(total>=4,total<6),"unlikely",IF(AND(total>=6,total<9),"possible",IF(AND(total>=9,total<12),"likely",IF(AND(total>=12,total<=16),"certain","---"))))
"---" is there in case the total is ever >16 by accident.
I gave the cell containing the sum the range name total to make the formula a little easier to read. If you don't like that, substitute SUM(Z13:AC13) for total.
I think the problem with your formula is the parenthesis after (for instance), the word "unlikely". It messes up the nesting. You don't want
IF(OR(SUM(Z13:AC13)>=4,SUM(Z13:AC13)<6),"Unlikely"),IF(OR...
you just want
IF(OR(SUM(Z13:AC13)>=4,SUM(Z13:AC13)<6),"Unlikely",IF(OR...
Simpler example showing the substitution of a whole second IF statement for condition-if-false:
=IF(criterion,condition-if-true,condition-if-false)
=IF(criterion,condition-if-true,IF(criterion,condition-if-true,condition-if-false))
Try it for practice:
Cell A1: blank cell for data
Cell B1: enter the formula =IF(A1="a","a",IF(A1="b","b","neither"))
Then enter a, b, or c into A1 to see what happens in B1.
A good tip is if you're having trouble with a formula, abandon your real data for a minute and make a dummy example that's as simple as possible. Get that to work, and then substitute your real conditions one step at a time.
I have few formulas in a row and I want to drag them down. Formulas are complex and I don't have them in R1C1 format and I don't want to convert them into R1C1, but I would like to do something like:
Range(A2:B10).Formula = Range.(A1:B1).Formula
I know this would put the same formula into the whole range, I need a "drag effect" - so it's changes relatively to each row but without copy-pasting.
P.S. I don't want to copy-paste, as it eats more CPU, I'd like to have something
Define the range that you want to fill with the formula and use Range.FillDown.
Range("A1:B10").FillDown
Note: The first Row(s) of the range must include the original formulas
A tiny trick !:
Sub KopyFormulas()
Range("A1:B1").Copy Range("A2:B10")
End Sub
will copy the formulas downward and adjust them as well !
For single cells, you don't need to explicitly convert formulas to R1C1 format to use FormulaR1C1.
Even if you are using the standard A1 style of referencing, you can still use
Range("B2:B10").FormulaR1C1 = Range("B1").FormulaR1C1
And this will have the effect of copying down the formula in B1. It doesn't change the default format -- they will still display in the A1 format.
There does seem to be an issue with doing this with a block of two or more cells. You could do it column by column (in a loop if desired):
Range("A2:A10").FormulaR1C1 = Range("A1").FormulaR1C1
Range("B2:B10").FormulaR1C1 = Range("B1").FormulaR1C1
Whether or not this is worth the hassle (compared to the simple .FillDown) is another question. You could time it.
By the way -- I wouldn't think that .FillDown is particularly inefficient. Did you do the usual optimizations of turning off of screen-updating, setting calculation to manual, etc.?
I use this formula always for copy data from sheet2 to sheet1 with data matching condition. Normally it works fine But Why This formula not work with large text query.
Formula:
=IFERROR(VLOOKUP($A1,Sheet2!$A:$E,COLUMN(),FALSE),"")
Any best formula or VBA will be helpful for me.
Usually, when Vlookup formulas stop working when they worked in the past, it generally means that something changed in the data. I would suggest looking at the formats of both sheets and for extra spaces or non-printable characters in the cells.
I have a matrix of data and each cell is a formula. All cell formulas are relative, so when I copy and paste just below, the formulas are now off.
Here's what I know works:
Change each cell's formula from relative to absolute
Copy the text from each formula, then paste this text below
I don't want to go and F4 each part of every formula for dozens of cells. Is there a way to copy paste a large batch but tell Excel to keep the exact formulas as written?
I personally do a bulk Find and Replace on the original range, replacing all "=" signs with a random text string which is guaranteed to not occur anywhere within those formulas, my usual choice being "##".
This converts all the formulas to text strings, after which you can paste the range before then performing the reverse Find and Replace, i.e. replacing "##" with "=", which coerces Excel into treating the strings as actual formulas once more.
Of course, if we're talking about a very large amount of formulas, i.e. several thousand, then this operation can take a while to perform, since not only is Excel required to carry out the Find and Replace on all strings, but also to calculate all the newly-created formulas.
Regards
When pasting, right click and choose "Paste Special" and use "Paste Formulas" (the fx icon).
Edit: Ah, I realize now this only works for 'fully anchored' ($A$1) cell references.
I have a column of values created from a formula, I know I can copy the values over to another column by using the clipboard. BUT...I want my spreadsheet to be automatic whilst avoiding the use of VBA coding, so it would be ideal if I could create a formula for the next column which copies the VALUES over to the next column. Maybe an INDEX/MATCH kind of method but one that copies ONLY the values rather than the formulas.
So in essence I want a formula to copy the values from a formula....
You can use =A4, in case A4 is having long formula
Use =concatenate(). Concatenate is generally used to combine the words of several cells into one, but if you only input one cell it will return that value. There are other methods, but I find this is the best because it is the only method that works when a formula, whose value you wish to return, is in a merged cell.
For such you must rely on VBA. You can't do it just with Excel functions.
you can use those functions together with iferror as a work around.
try =IFERROR(VALUE(A4),(CONCATENATE(A4)))
What about trying with VLOOKUP? The syntax is:
=VLOOKUP(cell you want to copy, range you want to copy, 1, FALSE).
It should do the trick.
Copy the cell. Paste special as link. Will update with original.
No formula though.