+ Reply to Thread
Results 1 to 19 of 19

Copy positive and negaive numbers from a row to another cell

  1. #1
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Copy positive and negaive numbers from a row to another cell

    Hello,

    I want to find all positive and negative numbers in a row and copy them us numbers in one cell (as separate numbers).Alternatively in two cells (positive-negative)

    I hope someone can help me out.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Copy positive and negaive numbers from a row to another cell

    In Cell J2, enter this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    - then copy and paste the cell into Cell K2

    In Cell J3, enter this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    - then copy and paste the cell into cell K3

    Is that what you are looking for?
    <<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts

  3. #3
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Re: Copy positive and negaive numbers from a row to another cell

    Thank for your help
    It works fine but i want to have the actual numbers in Cell K2 (=4,96+54,96+20+58+85)

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

    Re: Copy positive and negaive numbers from a row to another cell

    Is your 2021 Excel 2021 or Excel 365 by any chance?
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Copy positive and negaive numbers from a row to another cell

    This will give the values as text, but will not show the total value:

    ="="&LET(c,CONCAT(FILTER(D4:D17,(A4:A17=J1)*(D4:D17>=0))&"+"),LEFT(c,LEN(c)-1))
    ="="&LET(c,CONCAT(ABS(FILTER(D4:D17,(A4:A17=J1)*(D4:D17<0)))&"+"),LEFT(c,LEN(c)-1))

    Maybe have separate columns for the value string and the total value?
    Last edited by AliGW; 05-05-2023 at 05:13 AM.

  6. #6
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Re: Copy positive and negaive numbers from a row to another cell

    No i want to sum the separate values (=4,96+54,96+20+58+85) -> 222.92

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Copy positive and negaive numbers from a row to another cell

    You cannot show the values in the cell and sum them using a formula. Might be possible with VBA - shall I move the thread for you?

  8. #8
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Re: Copy positive and negaive numbers from a row to another cell

    ok maybe compine the two formulas to give the sum (positive and negative numbers based on A column ?
    Better explaine -> I want to sum all numbers in 423 (April dates ) in K2
    It will be huge help for me.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Copy positive and negaive numbers from a row to another cell

    Did you try what I suggested?

    See the attachment for it in situ.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Re: Copy positive and negaive numbers from a row to another cell

    yes but not helpful,i want the sum

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

    Re: Copy positive and negaive numbers from a row to another cell

    But you said you wanted all of the numbers, and I have already told you that you cannot have both the numbers and the sum with a formula.

    The closest I can get you is this:

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    I
    J
    12
    POSITIVE =4.96+54.96+20+58+85=222.92
    13
    NEGATIVE =30+32+112=-174
    Sheet: Sheet1

    BUT it's text and can't be used in any other calculation as it is.

    ="="&LET(c,CONCAT(FILTER(D4:D17,(A4:A17=J1)*(D4:D17>=0))&"+"),LEFT(c,LEN(c)-1))&"="&SUMIFS($F$4:$F$17, $F$4:$F$17, ">0", $A$4:$A$17, J$1)
    ="="&LET(c,CONCAT(ABS(FILTER(D4:D17,(A4:A17=J1)*(D4:D17<0)))&"+"),LEFT(c,LEN(c)-1))&"="&SUMIFS($F$4:$F$17, $F$4:$F$17, "<0", $A$4:$A$17, J$1)

    If this is no good, then you will have to go with VBA.
    Attached Files Attached Files
    Last edited by AliGW; 05-05-2023 at 05:47 AM. Reason: Typo fixed.

  12. #12
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Copy positive and negaive numbers from a row to another cell

    Out of curiosity, is there a specific reason why you are trying to show it like this instead of just using the answer?

    If it's just to get a sense of how the data is flowing through, could you instead consider applying filters the table?

  13. #13
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Re: Copy positive and negaive numbers from a row to another cell

    for AliGW #7 and #11 Maybe i wasnt clear.You said "You cannot show the values in the cell and sum them using a formula."Ok i can live with that
    I want at least the sum

    Maybe compine the two formulas to give the sum (positive and negative numbers based on A column ?
    Better explaine -> I want to sum all numbers (positive and negatives based on 423 (April dates ) in j4 (18.59)
    It will be huge help for me.

    ps1 I dont know how to deal with yours suggestion in L12
    ps2 English is not my native language please bear with me
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Re: Copy positive and negaive numbers from a row to another cell

    for AskMeAboutExcel
    The file is a bank account cashflow and i want in specific date to extract data in another workbook

  15. #15
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Copy positive and negaive numbers from a row to another cell

    Are you looking for something like this? :Book1_test - Copy.xlsx

  16. #16
    Registered User
    Join Date
    05-20-2005
    Location
    Thessaloniki Greece
    MS-Off Ver
    2021
    Posts
    39

    Re: Copy positive and negaive numbers from a row to another cell

    Very close to what i need.But is it possible to have the result (one formula) in one cell (positive and negative numbers) based on date (423) ?

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Copy positive and negaive numbers from a row to another cell

    @AskMeAboutExcel

    Administrative Note:

    Please include formulae used in your post in addition to providing a workbook (for the benefit of members unable to download attachments).

    Thanks.

  18. #18
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Copy positive and negaive numbers from a row to another cell

    Sure. Using the original location of the date in cell J1

    For positives:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    For negatives:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    @jimapos - if I'm understanding you correctly now, you are looking for a method to automatically build the formula you typed in cell J2? If that's the case, the only way to do this is through VBA. Which is possible, but complex, and from your use case I still don't see why that would be useful.

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Copy positive and negaive numbers from a row to another cell

    I am really not sure what you want, but I suspect that it won't be possible with a formula, as I mentioned much earlier in the thread.

    ps1 I dont know how to deal with yours suggestion in L12
    No idea what you mean by this - sorry.

+ 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. How to add positive and negative numbers based on the text on another cell?
    By helenmhp8 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2020, 07:17 AM
  2. Sum positive/negative numbers based on text of another cell
    By jeffkirk in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-24-2020, 11:02 AM
  3. [SOLVED] Format cell colors based on another cell values with positive and negative numbers
    By rlowry in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-30-2017, 12:10 PM
  4. Separate positive & negative numbers from on cell
    By tselek1985 in forum Excel General
    Replies: 3
    Last Post: 06-11-2015, 08:14 AM
  5. [SOLVED] Copy negative numbers and positive numbers
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2013, 08:06 AM
  6. adding positive and negative numbers all as positive
    By tomvh444 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-18-2009, 04:08 PM
  7. [SOLVED] Looping and inserting negaive totals
    By Jim May in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2006, 11:15 AM

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