Hello
I have this function line:
=INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+2)
I need to replace the "+2" to "+3" if the cell "A2" contains the letter"t" among
other letters and numbers in the cell.
Thanks
Oleg
Hello
I have this function line:
=INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+2)
I need to replace the "+2" to "+3" if the cell "A2" contains the letter"t" among
other letters and numbers in the cell.
Thanks
Oleg
try
=INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+2+ISNUMBER(SEARCH("t",A2)))
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Bob, I had envisaged something more like this:
=If(IsNumber(Search("t",A2)),INDEX(Sheet1!$C:$C,Match(A2,Sheet1$B$B,0)+3, INDEX(Sheet1!$C:$C,Match(A2,Sheet1$B$B,0)+2)
On the basis that if it finds the value "t" in A2 it changes the function to +3 else remains at the original function. I'm guessing I must be wrong then.
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
hi thanks
say where do i see that instead of"+2" is "+3"?
HiOriginally Posted by Aussiebear
thanks for the quik replay
i will check it in a few minuts i think you that this is what i need
hi
this is not working it gives me some excel error but i think the idea is exactly what meant
Post the error message. We can't see over your shoulder
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
Well, 3 is 2+1, so you don't need to test for the letters and repeat the core formula, just add 1 if t is in cell A2.Originally Posted by Aussiebear
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Or to put it another way, you can simplify yours to
=INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+2+IF(ISNUMBER(SEARCH("t",A2)), 1,0))
which is the same as mine, I just use no IF statement
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
There are a few typos in Bear's answerOriginally Posted by oleg_v
=IF(ISNUMBER(SEARCH("t",A2)),INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+3) ,INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+2))
but mine is better.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
i fixed the error but the results are not what i need
when the cell "A2" contains the letter "t" this writes me N/A instead of activating the index function and when the cell does not contain the letter "t" it writes me "false" instead of activating the other index function.
Thanks
Please post your workbook
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
HI
Attached the file in the sheet1 you can see the dimensions
in the sheet2 you can see the index function
My formula works perfectly, although it should be 2.071 not 0.061 because 0.061 is 4 rows beyond, not 2.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
My testing shows that the following formula works;
=IF(ISNUMBER(SEARCH("t",A2)),INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+4) ,INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+2))
My thanks to Bob for the hints
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
As doesOriginally Posted by Aussiebear
=INDEX(Sheet1!$C:$C,MATCH(A2,Sheet1!$B:$B,0)+2+(ISNUMBER(SEARCH("t",A2))*2) )
assuming an error on the original post, corrected later by the OP
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Bob, I think the issue comes about because not enough information was provided in the initial post. I am firmly of the opinion the people should where ever possible attach a workbook. This way those trying to assist get to see a fuller picture. But then I'm preaching to the converted in your case.
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
Thanks
In the futute i will provide more information and attach the workbook
great job every one and thanks a lot
Please mark the thread as "Solved" by using the Thread tools options just above the first post
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link