I have some excel formulas like referring to different columns and updating in particular cell. Is there a smart way of handling my Alteryx?or we need to go cell by cell and build formulas in Alteryx. Attached is the example.Q52 gets calculated by referring to Q51,Q49,Q50,F59.
There are several ways you can do this, I have done this in past, but the approach has been different based on the parameters.
If you know the logic on what basis references are made, you can build that.
Now I would recommend analyzing whether it is quicker for you to make formulas per column or a generic formula that can work for all the columns. If you are going to spend a lot of time in making a generic logic, it's good to go with per column formula, as in future it is easier to debug as well.
The way that I would approach this, is to show formulas in Excel, then copy that table into a text input and you can then programmatically parse the formulas to work out the patterns. That is unless you know the logic. It's then your call whether you create them into the formulas and copy/paste that into the formula tool, or create the XML of the Formula Tool and insert it all at once (a little more advanced).
Remember that in Alteryx you can easily change the data format to put multiple rows on one line, or transpose the whole lot etc. Often times these type of Excel formulas wind up a bunch easier in Alteryx if you can replicate the method/goal and not just replicate the formula.
An example of one I did recently:
You can refer to this post, it might be helpful to your case. If it helps, feel free to like the comment
https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Is-it-possible-to-retain-a-for...
@dreldrel , thanks for sharing this. Let me clearly explain what I want to do. I have cell level formulas in one column in excel which might not be the same formula in each cell. I want to read this excel with formulas in alteryx and then perform calculations in alteryx by using those formulas and then value paste the output in alteryx to excel . I dont want the formulas to be there in excel. Attached is the sample input and output. Output must be in alteryx and that gets value pasted to excel template with the same format which was used to read the excel formulas to alteryx. Is it possible? Appreciate any help with workflow on this.
Hi @Happylife2025 ,
Alteryx does not natively read Excel cell formulas. The Input Data tool uses the Excel engine, which only returns the calculated values, not the formula strings.
Two possible approaches in my opinion:
- Use Python within Alteryx : You can leverage the Python tool with libraries like openpyxlto extract the actual formulas from Excel cells.
Excel-side workaround
- Add a helper table in a hidden sheet of your Excel file using the =FORMULATEXT(cell) function. This will expose the formula as plain text, which Alteryx can then read.
You also mentioned applying Alteryx logic based on those formulas. This would require translating Excel formulas into Alteryx logic, which isn’t automatic. The best approach is to recreate the logic directly in Alteryx.
For example, if your Excel formula is a SUM, extract the relevant cells and apply a Summarize tool in Alteryx to replicate the calculation.
Finally, if you need to dynamically write results back to a specific cell or range in a template, you’ll need to build a Dynamic Output Macro that targets the desired sheet and cell range.
Hope it helps!
@MinhLO , thanks a lot. Can you demonstrate more by using a workflow. For example if one cell has formula like =P13+P18+P23 to populate in cell P24 and another formula like =MAX((P18+P23-P28)-2/3*P13,0) to populate in cell P30 and other cells as =SUM(P20:P22), how to design the workflow?
@Gaurav_Dhama_ , thanks.
@KGT , seems interesting. Thanks a lot. Is it possible to share the workflow for me to understand more?
What you can do is apply my logic with the Excel formula to create the new sheet (as in the document attached).
Then load this sheet in alteryx, and you can apply the logic that @KGT put in his comment :)
User | Count |
---|---|
107 | |
85 | |
76 | |
54 | |
40 |