Hello, its the EXCEL guy once more
I have my problem almost solved, but I need your help for the final task
I need to copy and replace the value of one column B on to the other column A, which is the original.
Up to now, I have extracted the values of the column A and manipulated them in a column B. Now I want to replace the original values with the ones that result from my calculations.
e.g.
I have the original column A
A B
1 2
2 3
3 5
4
5
I'm only interested in values 2 3 and 5, so I extract them to a new column B. After operating with them, I want to replace the original positions with the new values.
How do I do that?
Pic related, I have extracted the values marked as "CC" and converted them, now I want to replace the original ones
>>278391
Are the CC cells in the same row where the replaceable cells are?
>>278408
Yea, the CC cells mark the row where the replaceable value (first column) is
>>278410
Then couldn't you just copy the first column to the side (to have original values) and then just use =if(column M(within the same row) is CC, put CC, otherwise use the value from original column)?
Or am I missing something here.
>>278432
the problem is that I need to tell excel that a certain value has been already copied and it has to jump on to the next one
I haven't tried yet, but I think the problem with your suggestion is that excel would overwrite the same value (the first one) over and over, instead of correlating the cells.
>>278439
?
>>278440
As I told you, I need the formula to advance ONLY IF IT HAS SUBSTITUTED A VALUE
Here's what happens when applying your solution
>>278445
just to make sure it is clear
>>278446
In that case the easiest way (I think) is to write a macro code
Loop would go down the original column, the other one would advance if a replacement has been made.
something like
for( i=1 to end of range)
if(row i has CC)
put into the correct cell value from cell j
j+1
else
keep the original value
i++
So the j will advance only if there is a replacement made.
>>278453
Hmm that could work but I only know C programming, not VBA
Is there a way to translate that into excel functions?
>>278458
Well, you could do something like pic related.
Make 2 columns next to the CC on,
use an IF function to put 1 next to each CC and nothing otherwise
in next column sum all the 1s so far
For the main formula use the sum value to know which cell you should draw from.
It looks kinda ugly though.
>>278472
Thanks, that's working well
I don't care about ugliness if it's functional so thank you very much
Also, I'm having another problem, since using this formula to replace the original values is creating a circular reference which breaks my programming
Is there a way to create like a "memory" in excel, so that a function copies values from a certain reference and then pastes them in another column without creating a reference to it?
>>278735
I don't think I explained well my intentions so heres a picture with the process:
1. I extract the values marked as CC to a new column
2. I modify those values with some parameters
3. I introduce those values replacing their original positions
4. This new column should be the original one, but here comes the circular reference which breaks the sequence
How can I extract the data from the first column and then break the reference?
>>278752
>enabled iterative calculations
Oh wow. I didn't know Excel has something neat like this.