While AI hasn’t yet reached a sophistication level that allows accountants to kick up their feet and let the machines handle everything, it can be strategically deployed to accomplish tasks for which it’s well suited, using techniques that are proven to deliver results. The lowest hanging fruit may be leveraging ChatGPT to write Python code that will automate routine tasks, such as an accounting report.


ChatGPT can be used to automate the preparation of various reports, such as an aging of accounts receivable. The main point to take away from the demonstration is how one uses ChatGPT will determine the quality of the output one gets from it. Prompt engineering, defined as the process of structuring text that can be understood by a generative AI model, greatly impacts the quality of output you get from ChatGPT.


Aging of Accounts Receivable Report


Suppose you’re a company that has three customers (Purple Hypothesis Fitness, River Bend Club, and West Coast Fitness), and management needs an aging of accounts receivable report that looks like Table 1.




Before we start, ask yourself: How would you create this report? Most accountants complete this type of “table making” task in Excel, but that’s often a time-consuming process. Accountants with a knack for technology might explore newer software or even delve into coding to complete this task. However, for many newly minted and seasoned accountants alike, the prospect of mastering new software or coding can be intimidating.


The good news is ChatGPT can write, run, and debug computer code. “Low code” or “no code” chatbots such as ChatGPT and Bard can be guided by human conversation to do complicated tasks without the user memorizing detailed commands or syntax. This example shows how ChatGPT can write code that will create an aging of accounts receivable table for you. No Excel, no fancy new software, and no coding needed—all one needs to do is to have a conversation with ChatGPT just like one would with a junior analyst. ChatGPT can be the perfect virtual assistant.


Think of ChatGPT as an interface for working with a computer and data. In the past, computers couldn’t receive instructions in natural (human) language, such as English and Spanish. Instead, accountants needed coders to tell computers what to do. But AI empowers accountants to communicate with computers directly in natural human languages. You can think of AI as a “go between” between the accountant and the computer.


The following is a high-level outline of steps showing how an accountant can talk to ChatGPT to produce a report.


Steps for Creating an Aging of Receivables Report with ChatGPT


1. Ask ChatGPT to explain the hypothetical contents of a report on the aging of accounts receivable.


Here is a what we asked ChatGPT:



Try ChatGPT and see how it can help automate accounting tasks. For advanced analytics, users must subscribe to ChatGPT Plus.


Notice that we aren’t describing the details of the report ourselves. Instead, we ask ChatGPT to retrieve knowledge of an aging of accounts receivable. This is a way to plan ahead and work with ChatGPT to describe the end goal, which gives ChatGPT an idea of where it’s ultimately going. The actual data doesn’t come until step three. Depending on the description ChatGPT generates, you can customize the output and correct errors in an iterative fashion.


2. Ask ChatGPT to explain, in general, the steps needed to create the report from a list of invoices.


We’re again working backward by getting a detailed description of the task into the chat before asking ChatGPT to write code.


Here are our prompt and the response in this step:



Try ChatGPT and see how it can help automate accounting tasks. For advanced analytics, users must subscribe to ChatGPT Plus.


We’re working smarter, not harder, by giving guidance and having ChatGPT do the work. We’re asking ChatGPT to retrieve information and construct a plan for us, instead of writing the details ourselves.


3. Upload any data files containing the list of invoices and customers and ask ChatGPT how it should modify the plan it described in the previous step, now that it knows what the files look like.


For our simplified example, we’re going to upload Excel (or .csv) files with Tables 2 and 3.





In this step, we attached the two files to a chat prompt and asked ChatGPT, “Can you inspect the invoice list and customer list that we’ve uploaded and modify your plan accordingly?”


This highlights why it was so important to have ChatGPT form a plan before we uploaded the data. We’re giving ChatGPT the files after having asked for a description of the steps needed to generate the report, which ensures that ChatGPT will view the files with the appropriate context in mind.


ChatGPT is AI, so approach it like you would a human conversation. This type of sequential conversation will also help you give ChatGPT information about the aspects of the process that must be customized (e.g., file names and data structure). You can upload any type of data file in a ChatGPT prompt, so this is quite straightforward. Just be sure to turn on the code interpreter in your settings. (There are services available from OpenAI to ensure that data remains private and isn’t used for training purposes.)


4. Ask ChatGPT to self-critique and identify potential issues in the previous step.


Asking for self-critique can improve performance. Doing so adds an additional level of error-detection and correction to the process. Not only are you as a user making sure the content of the report is what you intend and the plan for creating it is sensible, but you can also have ChatGPT to serve as a second set of eyes. Although you can ask ChatGPT to self-critique at any step, we’ve found that it’s usually most important once ChatGPT starts writing code and dealing with data sets.


As an example, you might add the prompt “Please critically evaluate the code you have written to identify any errors in it.” You can add additional context if you are concerned about specific issues or potential errors. For example, you might use the prompt “Please critically evaluate the code you have written to ensure that it will satisfactorily handle missing values.”


5. Tell ChatGPT to write the code once its verbal description of the task is complete and accurate.


In this step, ChatGPT writes code (such as Python) to access the data and produce the table. You want to prevent ChatGPT from writing code until it fully understands the deliverable, the process for obtaining it, and the inputs it will use in the process. We’ve found ChatGPT will “jump the gun” and start writing code too early if not discouraged from doing so, which is why we started by asking ChatGPT to describe the report we wanted and the steps needed to prepare it but didn’t tell it to write any code yet.


6. Review the code and output; offer suggestions for improvement.


The next step is to review the code and output provided by ChatGPT and offer suggestions to ChatGPT so that it can improve it. Often, ChatGPT will output code that the user can’t easily understand. We discourage accountants from using code without first establishing that it’s correct.


Thankfully, ChatGPT can help the user understand the code in at least two ways. First, the user can ask ChatGPT to write simpler code with better comments. Second, the user can copy and paste specific lines that they find confusing and ask ChatGPT to clarify what the code does. Surprisingly, little programming knowledge is required when the user exploits these two capabilities of ChatGPT. Ask ChatGPT to create a graphical user interface (GUI) and code file that can be used to run the code on the user’s computer. A GUI uses windows, icons, and menus to allow the user to complete the task instead of requiring them to write and execute code directly. For example, we asked ChatGPT to create a GUI that lets the user select files and prepare a report at the click of a button. Figure 1 shows the interface ChatGPT produced for us.




This looks similar to a window in an accounting software program. It demonstrates the ability of ChatGPT to help anyone, including those who feel technologically challenged. If you’re unsure how to do this, you can ask ChatGPT what information it needs from you to create a GUI. It will likely ask you what appearance and features you want the GUI to have. This final step helps make the code more usable after being downloaded to your own local computer.


Following these steps enables you to write code that can be used repeatedly, effectively automating the task of preparing an aging of accounts receivable. And the code was created through simply having a conversation with ChatGPT and explaining what needs to be accomplished. It’s like talking to a junior analyst who needs a bit more guidance than their extensive knowledge and capabilities would otherwise lead one to believe.


Dos and Don’ts: ChatGPT for Automating Tasks


Correctly employing ChatGPT can help accountants effectively use the tool for automating tasks.




ChatGPT has the potential to transform the field of accounting. We provided a simple example in which an accountant was able to produce a report on the aging of accounts receivable simply by conversing with ChatGPT. In this way, ChatGPT functions like an advanced accounting analyst. Generative AI is well trained to know accounting and can respond to guidance from the accountant to accomplish the desired task.


AI facilitates the automation of working with data by writing code to transform data in the desired ways. In this way, AI empowers accountants to do routine tasks in less time and focus on higher-value tasks such as managerial decision making. Accountants need to learn how to work with ChatGPT to unlock the full potential of its capabilities for accounting applications. The hope is that this example proves useful as you start experimenting with this exciting new AI technology. This wave of AI innovation that we’re experiencing could enhance your performance and take your accounting to the next level!

About the Authors