Is there a function that will swap cell values... or entire columns without having to store the data in a temp location?
A function can only affect the cell it's in. Any swap has to store one of the values somewhere temporarily. Excel hides this when you swap adjacent cells (or columns) with the cut and insert method. Othertimes, as in a macro, one set of values needs temporary storage so it's not lost when the other set is written over it. Do you have a specific situation in mind?
What I meant to ask was, is there a SWAP function?
lets say we have data in A and B
to swap data, i need to:
- Copy A to a temp
- Copy B to A
- Copy Temp to B
- Destroy Temp
I was just wondering if there was a pre-made function available. Although while waiting for my answer, I actually wrote my own, so its all good
I was just wondering if there was a pre-made function available.
If you are still wondering about not using a "temp" location, forget it. Logically, if you break down the process either in excel or as deep as what happens in the processor itself, it is impossible.
my initial question was quite vague, sorry to have wasted your time.
Also, thank you for answering my question
There is no swap function "built-in" excel.