First off, apologies if this is already a solved issue somewhere on the forum. This is my first time using the forum and I have not had luck finding this issue addressed in my search of it so far.
My question is how to populate a cell if a value of another cell contains a specific text, and, if it does not, I want to populate a cell X columns from the one that contains the if statement.
The logic i'm trying to capture is:
if Col1R1 contains "J", then Col2R2=Col1R1, else Col4R2=Col1R1
I've tried using offset(), but have not had luck.
When I use if(search("Text",CellX,1),CellX,CellY=CellX) It does not recognize the else statement. I feel this should work (could be wrong) but I'm not able to solve thus far.
Again apologies if there is a previous thread regarding this. Haven't been able to find it.
Last edited by Human; 10-04-2011 at 03:42 PM.
if Col1R1 contains "J", then Col2R2=Col1R1, else Col4R2=Col1R1
You need two IF Statements, one in Col2R2 and one in Col4R2
B2 - Col2R2: =IF(A1="J", A1,"")
D2 - Col4R2: =IF(A1<>"J",A1,"")
Regards
Thanks for the reply! I actually need this to be in one formula so I can drag it across the sheet. currently I have in cell H8 =if(search("X",B3,1), B3, N8=B3)
When I change the value_if_false parameter to a text result like "Boo", it does work, with the current N8=B3 it only returns "FALSE" in cell H8.
I've never tried to define a cell value in an if statement like N8=B3, so I'm probably making an ignorant error there in the first place.
Good news is the calculation does go to the Else statement when I put "Boo" as the value_if_false so I'm isolating the error.
Expressions 101: A formula returns a single value, which is displayed in the cell containing the formula. A formula cannot cause a value to appear in some other cell. It look like you are trying to say that when the IF condition is FALSE, then put the value from B3 into N8. But what Excel does is to evaluate the expression "N8=B3", which it does by comparing the values of the two cells. This is a comparison, not an assignment. The two cells are not equal, so the result is FALSE.
If you want a value in one cell under one condition, and a value in a different cell under a different condition, then you need a formula in each of the target cells, as shown by TMShucks.
Making the world a better place one fret at a time
||||||
If someone helped you, please click on the star icon at the bottom of their post
If your problem is solved, please update the first post:
EDIT, Go Advanced button, set Prefix to SOLVED
[code]
' Enclose code in tags like this
[/code]
Don't attach a screenshot--just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.
Right, it's still an evaluation and boolean.
Last edited by Human; 10-08-2011 at 09:41 PM.
You may wish to mark this thread as Solved. I guess it's not the answer you want but it's the best you're going to get.
Regards
I already marked as solved after the response from 6StringJazzer. Is it not showing this way?
Yes, sorry ... just me not noticing![]()
just making sure.
Last edited by Human; 10-08-2011 at 09:40 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks