Ethics behind using external excel freelancer to help with my thesis? I have been working very hard on my thesis and I have reached a point with my data where I am required to code.

I am no where near experienced in coding, and there is also not enought time left to learn it.

Simply, the coding is required to re-format the information and figures I already have.

I have used an external source (freelancer) to re-format my data and provide instructions as to how he has done it. I asked for instructions so I could carry out the task myself, and the reformatted data so I could  check this against my work. Now, I am not sure if this is ethical and could compromise my degree?

I have not used the re-formatted data or instructions yet - as I am now unsure. I want to ask my supervisor about the ethics of using external assistance but I am unsure if this is a good idea?

In order to re-order my information and make it easier to process my initial formula instead of the manual way which I have been doing (there are close to 980,000 rows), the excel freelancer constructed a macro to essentially do the same work (which I still have not completed manually). I 100% want to give credit, and of course do not want to do anything unethical which is why I am asking here for advice.

What I mean by reformat is creating a macro/code  that performs a process. I have been doing this manually and have not scratched the surface considering the large volume of data. The creation of the macro gives the same answers I have been getting manually. So essentially it is not creating anything new, except for the macro. I hope this clarifies things. Again, I do not want to pass any work as my own so I would appreciate any more advice!

What concerns me is that I paid this freelancer to create the macro, a very small fee. Nonetheless, it does not sit right with me. So, What exactly should I explain to my supervisor? Should I mention I have already found someone? Or will this raise suspicion?
From what you've said in your question, it doesn't sound like there's a problem here. You said the information and the figures are your own, you've just had some assistance with making the data easier to work with.

It doesn't sound like what's been done is much different than if someone had pointed out that Excel already has a function that does what you were doing in a more streamlined fashion. Of course, this would be perfectly fine.

It's quite common for a student to have had the help of someone else in the course of working towards their thesis. This is particularly the case in technical matters like coding. You just have to make sure that you acknowledge their assistance appropriately (typically, by saying in your Acknowledgements that they provided assistance with your data). It's perfectly acceptable to get help from other people in your work. Seeking advice from people whose expertise is different to your own is an extremely common part of academic work. Where it becomes problematic is when you don't acknowledge that the advice came from someone else, and you (even inadvertently) pass it off as your own. I don't see that the fee changes this at all.

If you want to know for certain that this is acceptable then you should obviously ask your supervisor. Just explain the situation in full and ask "Is it okay to include this work in my thesis?" The thesis has not been submitted yet. So in the case that what you have done is inappropriate then no damage has been done. You would just ensure that the figures that appear in the thesis were not those that the freelancer produced.