+ Reply to Thread
Results 1 to 16 of 16

[PQ] divide each row of a column by an item in the same column & add result to new column

Hybrid View

  1. #1
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    [PQ] divide each row of a column by an item in the same column & add result to new column

    Hi,
    I am running a lot of analysis, using tables and a lot of formulas.
    In the current example, I am running a vertical analysis, which is to divide all items of a column for a fiscal year by a single specific item.
    So, in the example file, I want to add a new column for each year and divide each item by the total assets value of that year.
    I hope anyone may have a clue about solving it.
    Attached Files Attached Files
    Last edited by daliye; 06-20-2023 at 05:41 AM.
    thnx!
    d!
    microsoft 365 apps for enterprise

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,959

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    divide each item by the total assets value of that year.
    What would this look like? Where have you mocked up expected results?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Thanks for the fast reply.
    I've added a trial query inside the file but could not complete it correctly. I hope that it is clear, or do you need further information?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,959

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    How does a non-functioning query show me what you want???

    Are these the type of extra columns you want?

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    F
    G
    H
    I
    31
    2018 Balance 2018 % 2019 Balance 2019 %
    32
    28715836
    1.85%
    43612637
    2.72%
    33
    36280
    0.00%
    36280
    0.00%
    34
    3796
    0.00%
    18
    0.00%
    35
    875855
    0.06%
    530279
    0.03%
    36
    29631767
    1.91%
    44179214
    2.75%
    37
    9915744
    0.64%
    9920274
    0.62%
    38
    1811027
    0.12%
    374428
    0.02%
    39
    21258377
    1.37%
    46673572
    2.91%
    40
    59336104
    3.83%
    44733660
    2.79%
    41
    107594745
    6.94%
    91265250
    5.69%
    42
    199915997
    12.89%
    192967184
    12.03%
    43
    229547764
    14.80%
    237146398
    14.78%
    44
    40000000
    2.58%
    40000000
    2.49%
    45
    2712830
    0.17%
    2771601
    0.17%
    46
    13030865
    0.84%
    13279372
    0.83%
    47
    55743695
    3.59%
    56050973
    3.49%
    48
    0
    0.00%
    20000000
    1.25%
    49
    17640000
    1.14%
    8108200
    0.51%
    50
    15123480
    0.98%
    15123480
    0.94%
    51
    32763480
    2.11%
    43231680
    2.70%
    52
    44551339
    2.87%
    56545873
    3.53%
    53
    26824819
    1.73%
    33846233
    2.11%
    54
    32499112
    2.10%
    12750304
    0.79%
    55
    390837
    0.03%
    669157
    0.04%
    56
    36774482
    2.37%
    34052178
    2.12%
    57
    141040589
    9.09%
    137863745
    8.60%
    58
    173804069
    11.21%
    181095425
    11.29%
    59
    229547764
    14.80%
    237146398
    14.78%
    Sheet: Sheet1
    Attached Files Attached Files
    Last edited by AliGW; 06-20-2023 at 04:36 AM. Reason: Typo fixed.

  5. #5
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Yes, it is.
    But a little thing is different, which is I want to divide each item in table b a specific item, which is "total assets", and not the total sum of the column.
    In some other cases, the item will be something else and not the "total assets".
    I thought about making a parameters list of items that will be used in calculations, then using it, but do not know how to fix it.
    So, how to adjust it to be the total assets instead of the total of the column?

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,959

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Right - so please mock up a column to the RIGHT of your data table. Use the 2018 balance and give the value you expect to see in each row. To the right of that, explain the sum that you would have to do manually.

    I am NOT going to waste time guessing. Your explanation is completely inadequate - sorry.

  7. #7
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Thanks a lot, my friend.
    I've reviewed your steps in detail and understood the idea, and then applied it.
    File attached.
    Thanks a lot
    Attached Files Attached Files

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,959

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    And is that producing the results you expect?

    I asked for a MANUALLY CALCULATED column (NOT created using PQ!) with your EXPECTED results.

  9. #9
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Thanks for your valuable time helping me.
    Yes, it does .
    I am afraid that I do not understand what you mean by MANUALLY CALCULATED.
    Do you mean that you are asking if I want to do it manually? or do you mean that I create a column manually with the expected results I want to be done using power query, so you can create it for me using power query?
    Which one do you choose?
    Or do you mean something else?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,959

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Never mind - it's solved.

  11. #11
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Yes, it is :D .

  12. #12
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    If I want to do some adjustments, shall I continue here or start a new thread?

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,959

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    What type of adjustments? Tweaks here, additions in a new thread.

  14. #14
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    New addition.
    New thread then.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,959

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Yes, with appropriate title.

  16. #16
    Forum Contributor daliye's Avatar
    Join Date
    05-28-2023
    Location
    North Africa
    MS-Off Ver
    microsoft excel, latest 365, 64-bit!
    Posts
    310

    Re: [PQ] divide each row of a column by an item in the same column & add result to new col

    Lesson learned my friend.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 04-17-2020, 08:45 AM
  2. Replies: 0
    Last Post: 03-07-2016, 08:38 PM
  3. [SOLVED] Dynamic search; using column # result to determine column used for column/row match.
    By David Brunk in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2014, 09:57 PM
  4. [SOLVED] Want to divide and result show on other column Solved by : FDibbins
    By HaroonSid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-30-2014, 04:14 AM
  5. Add Date in Column A Plus Number of Days in Column B and show result in Column C
    By excelforumcrisis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2013, 02:01 PM
  6. Ping Host Name Column A IP address Result column B Response time Column c
    By NickMac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2012, 03:23 AM
  7. Replies: 5
    Last Post: 05-17-2012, 10:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1