+ Reply to Thread
Results 1 to 30 of 30

How can I add multiple values cointained in one single cell?

  1. #1
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    How can I add multiple values cointained in one single cell?

    Hello!!

    I'm a new member of this forum! I registered because I have to solve a problem in Excel and I was hoping that you guys can help me!

    I have to sum multiple values cointained in one single cell (see attachment to have an idea of the problem), but I don't really know how to do this. I have never used VBA, but I am willing to learn by myself (if you know some books that I can buy it would be appreciated). Meanwhile....can you give me some hints?

    Thank you in advance,
    Sarah
    Attached Files Attached Files

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: How can I add multiple values cointained in one single cell?

    Try this:-
    To Save and Run UDF:-
    Copy Function from Thread
    In Your Data sheet , Click "Alt+F11",:- Vb Window appears.
    From the VBWindow toolbar, Click "Insert" ,"Module":- New VBwindow appears .
    Paste Code into this window.
    Close Vbwindow.

    In sheet, Add the "function" in a cell as :- =nSum(A1)
    NB:- Once you've add the first bracket you can select the cell "A1" from the sheet
    Then click "Enter"
    The cell should now show the result, in this case 100.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Hi MickG. Thank you! the formula works and I've applied it to my spreadsheet! Just another thing, I've noticed in my spreadsheet that sometimes in the cell it appears also "-" (see attachment). This means that when I apply the formula that you suggested I get "VALORE" (italian word for "value"). Is there any way to transform that "-" into a 0?

    Moreover, I am a little bit stupid, because I forgot to mention that my task is to sum just the first 3 values contained in the cell (sometimes I have even 10 values in the same cell, but those to be added are the 3 with the HIGHEST value). Is there a way I can do it? Sorry I forgot to give you an important information

    Thank you again. You saved my life!
    Attached Files Attached Files

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Quote Originally Posted by Sarah17591 View Post
    my task is to sum just the first 3 values contained in the cell
    Quote Originally Posted by Sarah17591 View Post
    those to be added are the 3 with the HIGHEST value
    Ciao,

    Queste due affermazioni non sono necessariamente coerenti. Volevi dire "first" o "highest"?

    Inoltre, in questo file il valore in A1 inizia con un ">". È sempre cosi?

    Saluti!
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: How can I add multiple values cointained in one single cell?

    What does the ">" represent, and what do you want the code to do with it ????

  6. #6
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Ciao XOR LX,

    è verissimo quello che dici. Fai conto che queste sono le quote degli azionisti di un'azienda e il database li ordina direttamente, per cui i primi tre azionisti sono anche quelli che detengono le quote maggiori.
    Per quanto riguarda >50, compare in alcuni casi e non so bene come trattarlo, perché non è un numero preciso (ma il database da cui posso scaricare i dati fa davvero schifo). Sono tentata di trattarlo come 50 e al massimo aggiungere un > al risultato finale. Io farei così. Poi quando il professore tornerà dal suo viaggio di lavoro, al massimo chiedo a lui se ho fatto bene.
    Tu cosa pensi? Esiste un modo per eseguire le operazioni così come ti ho detto?

    Grazie mille!

  7. #7
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Hi MickG...it means that the value is higher than 50. I was thinking to treat it as a 50 and then add > to the result to say that the result is higher than the number given by the sum. I don't know whether this is correct, but the database where the data come from is not very good. I will ask my professor what he thinks when he'll come back from his business trip.

    Thank you

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Ciao Sarah,

    =REPT(">",LEFT(A1)=">")&SUMPRODUCT(0+MID(SUBSTITUTE(SUBSTITUTE(A1,">",""),CHAR(10),REPT(" ",20)),{1,21,41},20))

    In Italiano:

    =RIPETI(">";SINISTRA(A1)=">")&MATR.SOMMA.PRODOTTO(0+STRINGA.ESTRAI(SOSTITUISCI(SOSTITUISCI(A1;">";"");CODICE.CARATT(10);RIPETI(" ";20));{1\21\41};20))

    Saluti!

  9. #9
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Ciao XOR LX,

    ho provato a implementare la formula, ma non funziona!

    Grazie lo stesso!

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Quote Originally Posted by Sarah17591 View Post
    ho provato a implementare la formula, ma non funziona!
    Funziona usando il file che hai allegato. Magari puoi approfondire il commento "non funziona" con alcuni esempi?

    Saluti

  11. #11
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    ehmm...l'ho provata sia sul file originale in cui devo applicarla (l'intera colonna di un foglio excel con dati relativi a diverse imprese), sia sul foglio che ho allegato. Mi viene fuori VALORE.

    Saluti

  12. #12
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Ho capito, ma ovviamente non posso aiutarti se non so i valori per i quali la formula dà un errore. Uno o due esempi sarebbe sufficiente.
    Last edited by XOR LX; 09-23-2016 at 11:52 AM.

  13. #13
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Oltre a quelli del file che ho allegato prima (per intenderci quello che iniziava per >50), non funziona anche su questi valori (see attachment)
    Attached Files Attached Files

  14. #14
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    C'è un problema con il tuo file. Se, per la formula in B1, io vado nella barra della formula e poi premo INVIO, allora funziona benissimo. Poi copiare questa formula giù.

    Saluti.

  15. #15
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: How can I add multiple values cointained in one single cell?

    Very nice but this site is in Englis or what?

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How can I add multiple values cointained in one single cell?

    This is the non-English forum. Is that a clue?
    Entia non sunt multiplicanda sine necessitate

  17. #17
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: How can I add multiple values cointained in one single cell?

    Verry nice!!!!

    It is common sense to not write in another language, what would be the answer in Chinese or Japanese, ect
    If so, then let's write each, which language we want

    Вы думаете, что вы умный?

    あなたがスマートだと思う?

  18. #18
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How can I add multiple values cointained in one single cell?

    Feel free to post questions here in whatever language you fancy.

  19. #19
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    @Indi_Ra

    I don't see the point of your argument. As shg said, the post was made in a subforum of this forum specifically geared towards questions posted in languages other than English.

    The fact that the OP posted in (very good) English is irrelevant, and they were evidently content to reply in Italian.

    If the content of this post is of interest to you, then I can help you translate it if you want.

    If you actually have a problem with the idea of a non-English subforum on this forum then perhaps you could explain why?

    Regards

  20. #20
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Ciao. L'altro giorno ero uscita dall'ufficio e non sono più entrata nel forum. A quale formula facevi riferimento? Quella dell'altra volta, mi dispiace, ma non funziona proprio Tra l'altro mi sono accorta che la gente ha qualche problema con le altre lingue. Mi sa che è "better to switch to english"..

  21. #21
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Quote Originally Posted by Sarah17591 View Post
    Ciao. L'altro giorno ero uscita dall'ufficio e non sono più entrata nel forum. A quale formula facevi riferimento? Quella dell'altra volta, mi dispiace, ma non funziona proprio
    Quella nel tuo file del post #13. Ai seguito le mie istruzioni del post #14?

    Quote Originally Posted by Sarah17591 View Post
    Tra l'altro mi sono accorta che la gente ha qualche problema con le altre lingue. Mi sa che è "better to switch to english"..
    That's entirely up to you. It's your post!

    Regards

  22. #22
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    L'ultima volta mi hai detto che il file non andava bene. A me non va per qualunque cella, anche quella del post #1. Tu mi avevi detto che, quando la provavi tu, ti bastava andare a capo e funzionava. A me no, mi dice sempre valore. Non è possibile farlo con VBA invece che con una formula? Tipo quella di MICkG funzionava, pero' mi ero dimenticata di dirgli che a me serve sommare solo i tre valori più alti di ogni cella, non considerare il simbolo ">" e non considerare i simbili "-", se presenti

  23. #23
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Quote Originally Posted by Sarah17591 View Post
    Tu mi avevi detto che, quando la provavi tu, ti bastava andare a capo e funzionava
    Non è vero. Hai bisogno di rileggere le mie istruzioni dal post #14, che fanno riferimento al file dal post #13.

    Saluti.

  24. #24
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Quote Originally Posted by XOR LX View Post
    C'è un problema con il tuo file. Se, per la formula in B1, io vado nella barra della formula e poi premo INVIO, allora funziona benissimo. Poi copiare questa formula giù.

    Saluti.
    Queste sono le tue istruzioni. Bene, se io adesso prendo quel file e premo invio nella barra della formula, mi viene fuori VALORE. Probabilmente sono idiota, ma davvero non riesco a cogliere altri significato nella frase che mi hai scritto.

  25. #25
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Usando la finestra di dialogo Valuta Formula (scheda Formule), puoi dirmi in quale momento appare la prima occorrenza di un errore #VALORE!?

    Forse alcuni screenshot sarebbe utili.

    Saluti

  26. #26
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Ciao XOR, ti ho fatto gli screenshot di cosa mi appare quando uso Valuta Formula.

    Saluti!
    Attached Files Attached Files

  27. #27
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Ahhhh!

    Ma qui in Italia la virgola rappresenta il separatore decimale, non il punto.

    Questi dati che stai analizzando vengono per esempio dal Regno Unito o degli Stati Uniti? Quindi sarà necessario convertirli alle versioni equivalenti italiani, vale a dire, per esempio, 37.79 a 37,79?

    Saluti.

  28. #28
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13

    Re: How can I add multiple values cointained in one single cell?

    Ciao XOR......FUNZIONA!!!! Grazie mille per avermi aiutata! Ho comprato un sacco di manuali per migliorare la mia conoscenza di excel, perché la prossima volta voglio essere in grado di risolvere i problemi da sola e aiutare gli altri (benchè sia un po' limitata)! Ti offrirei volentieri uno spritz! Grazie mille ancora!

  29. #29
    Registered User
    Join Date
    09-23-2016
    Location
    Treviso
    MS-Off Ver
    Windows 10
    Posts
    13
    Ciao XOR...scusa se torno a rompere! Volevo chiederti un'ultima cosa. La formula va benissimo quando in una cella ci sono più di tre valori contenuti in una cella, ma non quando ce ne sono solo due. In quel caso basterebbe fare solo la somma dei primi due. Se c'è solo un valore, invece, basta riportare solo quel valore. Pensi che si possa fare una modifica in questo senso?

    Saluti,
    Sarah

  30. #30
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How can I add multiple values cointained in one single cell?

    Quote Originally Posted by Sarah17591 View Post
    Ciao XOR...scusa se torno a rompere!
    Figurati!

    Quote Originally Posted by Sarah17591 View Post
    La formula va benissimo quando in una cella ci sono più di tre valori contenuti in una cella, ma non quando ce ne sono solo due. In quel caso basterebbe fare solo la somma dei primi due. Se c'è solo un valore, invece, basta riportare solo quel valore. Pensi che si possa fare una modifica in questo senso?
    =RIPETI(">"; SINISTRA(A1)=">")&MATR.SOMMA.PRODOTTO(0+STRINGA.ESTRAI(SOSTITUISCI(SOSTITUISCI(A1&CODICE.CARATT(10)&0&CODICE.CARATT(10)&0; ">"; "");CODICE.CARATT(10); RIPETI(" "; 20)); {1\21\41};20))

    Quote Originally Posted by Sarah17591 View Post
    Ho comprato un sacco di manuali per migliorare la mia conoscenza di excel, perché la prossima volta voglio essere in grado di risolvere i problemi da sola e aiutare gli altri (benchè sia un po' limitata)!
    Sono colpito dalla tua filosofia di apprendimento. Vi sono molti persone che continuano a visitare i forum per anni senza mai cercare di imparare da soli.

    Quote Originally Posted by Sarah17591 View Post
    Ti offrirei volentieri uno spritz!
    Ok! La prossima volta che sarò a Treviso!

    Saluti!

+ 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. [SOLVED] vLookup multiple values separated by ";" in single cell / return result in single cell
    By Tunesmith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2015, 12:02 PM
  2. [SOLVED] How to return multiple values to a single cell based on multiple criteria
    By lwallace in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-20-2014, 06:32 AM
  3. Multiple values in single cell
    By pra83 in forum Excel General
    Replies: 4
    Last Post: 11-15-2013, 12:06 PM
  4. [SOLVED] HELP: Need to separate values from a single cell with multiple values
    By MrBrownGuy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-24-2013, 07:46 AM
  5. Sum values from multiple cells - multiple lookup values in single cell
    By taxdept in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2012, 04:12 PM
  6. Multiple Values into a single cell
    By corea in forum Excel General
    Replies: 1
    Last Post: 05-09-2012, 02:48 AM
  7. Replies: 2
    Last Post: 02-20-2012, 06:06 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