topic Re: Referencing a cell, using a formula, given a static column value and generic row expression in Building Flows
https://powerusers.microsoft.com/t5/Building-Flows/Referencing-a-cell-using-a-formula-given-a-static-column-value/m-p/807570#M112436
<P>I honestly don't completely remember this particular issue. My instincts are that I tried Offset(), but that evaluates constantly, so supremely slows Excel performance. </P><P> </P><P>I believe the solution that worked involved using a Filter block. Filter has greatly improved performance in all my flows, and I wish I had learned about it way earlier. Filter the table for Location = "Location 1." This will leave you with one row with that location's details and accessing the email from there is easy.</P><P> </P><P><STRONG>Best Practice</STRONG><BR />After escalating a related issue through the Microsoft Support world, I was told that the solution for how to add formulas dynamically into Excel sheets is, don't do it. Basically, I was trained away from the approach described above using Flow to add formulas to Excel cells. The Best Practices approach is to put all your logic in Excel or all your logic into Flow, but don't mix; I still do, of course, but, in dire situations where I don't have the time to research the right way, I cheat, but carefully.</P><P> </P><P><STRONG>On Cheating</STRONG> (referenced from previous line)<BR />If you put formulas into your Excel sheet, you are going to want to make the calculated values static. The way I have done this is to, at the end of the flow, grab each row and over-write it with itself. Sounds useless, right? Well, what happens is, Flow reads the <EM>value</EM> of the Excel cell and not the underlying <EM>formula</EM> so, when it writes back to the cell what it read, it over-writes the formula with the static value.</P>Wed, 27 Jan 2021 15:27:50 GMTBenDonahue2021-01-27T15:27:50ZReferencing a cell, using a formula, given a static column value and generic row expression
https://powerusers.microsoft.com/t5/Building-Flows/Referencing-a-cell-using-a-formula-given-a-static-column-value/m-p/601379#M79400
<DIV><DIV><SPAN> I need a formula that will generate a cell address by matching a static column value with a dynamic row value</SPAN></DIV><DIV> </DIV><DIV><SPAN>I am using Forms/Flow to add rows to an Excel Sheet. Based on a location being selected, I want to enter an email address into a column. Because this formula is being entered into a cell as the row is created, I can't simply drag the formula down the column.</SPAN></DIV><BR /><DIV><STRONG>Solution 1</STRONG><SPAN><STRONG> that did not work</STRONG>: Accessing the value of the location (from Forms response) and conditionally adding an email address straight into the correct column using this expression in Flow: </SPAN></DIV><DIV> </DIV><DIV><SPAN>=IF(first(triggerBody()?[</SPAN><SPAN>'Which</SPAN><SPAN> </SPAN><SPAN>office's</SPAN><SPAN> </SPAN><SPAN>Office</SPAN><SPAN> </SPAN><SPAN>Manager</SPAN><SPAN> </SPAN><SPAN>is</SPAN><SPAN> </SPAN><SPAN>the</SPAN><SPAN> </SPAN><SPAN>Auditor?'</SPAN><SPAN>])= </SPAN><SPAN>"office1"</SPAN><SPAN>,</SPAN><SPAN>"EmailForThat@Office.org"</SPAN><SPAN>,</SPAN><SPAN>""</SPAN><SPAN>)</SPAN></DIV><DIV> </DIV><DIV><SPAN>This entered the correct email address, but broke functionality that populated the rest of the data into Excel, in that, the rest of the data entered into the Excel sheet directly from the form, was not entered. Removing this formula returned the functionality. From what I have read, this is the solution </SPAN></DIV><BR /><DIV><STRONG>Solution 2</STRONG><SPAN><STRONG> that did not work</STRONG>: Entering a formula into the email column cell that conditionally enters the email address based on the value in the adjacent Excel cell. The problem here is that, because I am creating a row when I enter this data into Excel, I both:</SPAN></DIV><DIV><SPAN>A) don't know what row this data will appear on, and</SPAN></DIV><DIV><SPAN>B) can't drag formulas to populate the cells dynamically from within Excel.</SPAN></DIV><DIV> </DIV><DIV><SPAN>Here are two examples of formulas I tried that did not work, but might help me communicate my issue:</SPAN></DIV><DIV><DIV><DIV><SPAN>=IF(H+(ROW())=</SPAN><SPAN>"LOCATION 1"</SPAN><SPAN>,</SPAN><SPAN>"EMAIL ADDRESS 1"</SPAN><SPAN>,</SPAN><SPAN>""</SPAN><SPAN>)</SPAN></DIV><DIV><SPAN>=IF(H(ROW())=</SPAN><SPAN>"LOCATION 1"</SPAN><SPAN>,</SPAN><SPAN>"EMAIL ADDRESS 1"</SPAN><SPAN>,</SPAN><SPAN>""</SPAN><SPAN>)</SPAN></DIV><DIV> </DIV><DIV><SPAN>Thank you.</SPAN></DIV></DIV></DIV></DIV>Fri, 19 Jun 2020 15:46:19 GMThttps://powerusers.microsoft.com/t5/Building-Flows/Referencing-a-cell-using-a-formula-given-a-static-column-value/m-p/601379#M79400BenDonahue2020-06-19T15:46:19ZRe: Referencing a cell, using a formula, given a static column value and generic row expression
https://powerusers.microsoft.com/t5/Building-Flows/Referencing-a-cell-using-a-formula-given-a-static-column-value/m-p/806680#M112293
<P>Hi - i'm running into a simmilar issue as this. Have you had any success?</P>Wed, 27 Jan 2021 00:48:13 GMThttps://powerusers.microsoft.com/t5/Building-Flows/Referencing-a-cell-using-a-formula-given-a-static-column-value/m-p/806680#M112293NiugeS2021-01-27T00:48:13ZRe: Referencing a cell, using a formula, given a static column value and generic row expression
https://powerusers.microsoft.com/t5/Building-Flows/Referencing-a-cell-using-a-formula-given-a-static-column-value/m-p/807570#M112436
<P>I honestly don't completely remember this particular issue. My instincts are that I tried Offset(), but that evaluates constantly, so supremely slows Excel performance. </P><P> </P><P>I believe the solution that worked involved using a Filter block. Filter has greatly improved performance in all my flows, and I wish I had learned about it way earlier. Filter the table for Location = "Location 1." This will leave you with one row with that location's details and accessing the email from there is easy.</P><P> </P><P><STRONG>Best Practice</STRONG><BR />After escalating a related issue through the Microsoft Support world, I was told that the solution for how to add formulas dynamically into Excel sheets is, don't do it. Basically, I was trained away from the approach described above using Flow to add formulas to Excel cells. The Best Practices approach is to put all your logic in Excel or all your logic into Flow, but don't mix; I still do, of course, but, in dire situations where I don't have the time to research the right way, I cheat, but carefully.</P><P> </P><P><STRONG>On Cheating</STRONG> (referenced from previous line)<BR />If you put formulas into your Excel sheet, you are going to want to make the calculated values static. The way I have done this is to, at the end of the flow, grab each row and over-write it with itself. Sounds useless, right? Well, what happens is, Flow reads the <EM>value</EM> of the Excel cell and not the underlying <EM>formula</EM> so, when it writes back to the cell what it read, it over-writes the formula with the static value.</P>Wed, 27 Jan 2021 15:27:50 GMThttps://powerusers.microsoft.com/t5/Building-Flows/Referencing-a-cell-using-a-formula-given-a-static-column-value/m-p/807570#M112436BenDonahue2021-01-27T15:27:50Z