User Profile
MAngosto
Iron Contributor
Joined 11 months ago
User Widgets
Recent Discussions
Treat a row as an array inside an array formulation
Hello there, Running Excel 365. Attaching a sample document for better understanding. I am trying to compute the final price of a product on each year of its project. The final price is based on an initial price and percentage discounts that are cumulative year over year. For this purpose, I use SCAN function and returns the desired output beautifully. Now, I need a second consideration for the computation of the price. There are some price components that expire before the end of the whole project. That is, I need to substract some amount from the price at a given date, since that concept is no longer computing to the final price and it has already been amortized. For this other purpose, I use some references that allows the final user only to enter the value that is going to be substracted and during how many years is this particular value going to be amortized. Then, the formulation "drops" that amount once the years of amortization are completed. These two functionalities (% discount and dropping price component) work when I formulate them apart. However, I need them to be together. The issue is that one of the ranges in the formulation for the latter functionality is not treated as an array and, therefore, it does not dynamically "move" within the range and everything breaks. How can I rearrange the formulation and make this range be a functional array (with minimum alteration of the concept behind this formualtion)? Thank you so much for any kind support. MartinSolved397Views0likes1CommentReferencing issue when running insert-rows-Macro
Hello there, I am struggling in a situation I hope anyone could help or provide any workaround. I am attaching a sample document to make the situation more clear. I run Excel 365. I have two set of rows 3-5 and 9-11. Each of these sets of rows contain 3 rows. I then have a macro that inserts a row to each of these sets. That is, whenever I need a new product name, 1 row is inserted in the first set, that would then go from 3-6 and 1 row is inserted in the second set, that would then go from 10-13. The pieces of code of that macro look as follows: Sub Add_Rows() Application.ScreenUpdating = False Sheets("Sheet1").Select Cells.Find(What:="Header 1", After:=ActiveCell, LookIn _ :=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False).Activate ActiveCell.Offset(rowOffset:=2).Activate ActiveCell.EntireRow.Select Selection.Copy ActiveCell.Offset(rowOffset:=1).Activate Selection.Insert Shift:=xlDown Sheets("Sheet1").Select Cells.Find(What:="Header 2", After:=ActiveCell, LookIn _ :=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False).Activate ActiveCell.Offset(rowOffset:=2).Activate ActiveCell.EntireRow.Select Selection.Copy ActiveCell.Offset(rowOffset:=1).Activate Selection.Insert Shift:=xlDown Application.ScreenUpdating = True End Sub The problem I have is that there are cells in all these rows that reference the other set of rows at the same time. That is, explained by colors (see attached document), cells in the first set of rows reference both cells in the same set of rows (blue) and cells in the second set of rows (orange). At the same time, cells in the second set of rows reference cells in the first one (blue and green). The real issue is that, whatever the order of the inserted rows in the VBA code is, there will always be some referencing that will be broken. I want that whenever the row is added, it follows the formulation of the cells above/below accordingly, but the formulation breaks (naturally, because it tries to reference a row that is not yet created). Is there any possibility to write additional code in order to handle this? Is it possible to write the code in a way that creates all rows simultaneously instead of reading the order of writing? Is this even possible to be worked around? I have tried with "Application.Calculation = xlCalculationManual" at the beggining and "Application.Calculation = xlCalculationAutomatic" at the end, but it does not work. Would the only solution be to first create all rows and then write the code to fill the formulation of all these newly inserted rows accordingly? Any help would be appreaciated. MartinSolved946Views0likes6CommentsUnable to use a nested IF(AND) function in an array function (Discussion)
Hello there! I came across the following discussion on the community: https://techcommunity.microsoft.com/t5/excel/two-wrongs-don-t-make-a-right-negative-worker-values-are-turning/m-p/4114539 Looking at the response byPatrick2788, I was trying to play around with his proposed function. It was rather more intuitive to me to use a nested IF(AND) function and I was surprised it does not work for an array function. I was just wondering if anyone knew why this happens and the logic behind this. Tested the IF(IF) function as well as a single IF(("logic1")*("logic2")) and both worked efficiently. Why wouldn't a nested IF(AND) function serve here? Appreciate any kind response. MartinSolved972Views0likes5CommentsHelp creating a complex formula to deduct a % from decreasing varying values
Hi there, I am running Excel 365. I am attaching a sample document for better understanding of the problem, it is quite complex. I have such a scheme as follows: For 6 years, I have got a product with a fixed initial price that is subject to discounts on each year, with a set number of units of that product and, therefore, a set amount of revenue per year. Paralelly, I also have a fixed % of a cost (in my example, 1%) that is paid by the client inherent the product's final price. My current Excel file computes the total yearly revenue taking into account the initial price for the client, the discount (if there exists) and the 1% additional cost paid by the client (as well its proper discount - which also has- computed with the same rates as the discount for the original price). What I want to achieve is to separate the calculation of the annual revenue from the actual starting price & discount on one side, and then compute the annual revenue from the 1% charged to the client on the other side. At the end, both totals should sum up my current total yearly revenue. Important remarks: - None of the other formulas or structure may change. - In my sample file, there is only 1 row for 1 product, but this changes constantly. There may be 3 products for a moment, for which the rows for their respective prices, discount %, units and totals would appear (with created macros) beneath each "product 1" row. Therefore, it should be considered when creating the formula. I hope I have explained my problem clearly enough. Any help would be much appreciated! MartinSolved1.1KViews0likes5CommentsFilter a range of cells with headers and data based on a criteria and construct a Table (VBA)
Hello experts, I am runningMicrosoft® Excel® for Microsoft 365 on Windows 10. Please kindly refer to the sample images attached below for a better understanding of the context. The first sheet displays my actual setting, and the second one shows the expected outcome. I currently have a range of cells simulating an actual "Table" from Excel objects. It is simply a range of cells where column and row headers can be found, as well as inside data values. It simulates fruit imports for different countries, where column headers are the labeled countries and row headers are the type of fruit these are importing. The inside data values are just quantities. On the other hand, I have a vertical list with all headers (column and row headers, both included), with an adjacent cell indicating the condition "true" or "false" for each of them. These criteria will dictate whether that specific header will be considered or not when constructing the filtered Table. The goal is to generate on a newly created sheet an actual Excel Table that only displays the information of those rows and columns that had the value "True" in the list of conditions. That is, only populate the filtered table with those headers marked as "True", as well as their corresponding inside values. A couple of additional notes: - The format of the "original full table" as well as the list of conditions cannot be changed. In reality, it is a large range of cells with a lot of columns and headers, and the list of conditions is formatted in that way purposefully. - The inside data points (in my example, quantities of imported fruit) of my original full table do have different text formats. Some may be expressed as currencies, others as simple numbers. Ideally, the filtered table should contain the same format for each data point, but I could also do it if they all remain as numbers if the latter is not possible. I have been trying for several days to run an efficient code for this, but I was not even close to getting it. Need fresh ideas. Images for context: & Criteria Thank you so much in advance for your kind help. MartinSolved2.5KViews0likes12Comments
Groups
Recent Blog Articles
No content to show