Dear Friends,
Need help how to create a formula
in column A there is 2/100,3/400, 5/100, 6/100, 7/100, 8/100 and in column B is total. total should be 900
Please advise which formula need. for details, please find the attached file. thank you
Wie
Dear Friends,
Need help how to create a formula
in column A there is 2/100,3/400, 5/100, 6/100, 7/100, 8/100 and in column B is total. total should be 900
Please advise which formula need. for details, please find the attached file. thank you
Wie
Last edited by AliGW; 12-30-2016 at 01:10 PM.
Hi,
What is 2/100, 3/400, is it row number 2 and 3 and value it contains? Can you elaborate a bit more?
You might want to view the attachment, Hitesh.
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.
Hi Hitesh,
2/100 = size/qty. details in attached file. thanks
Wie
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Hi
Although a formula could work for your sample,
I doubt that a formula is what you are looking for.
Paste this code into a Macro Module.
Please Login or Register to view this content.
Then put this formula into B2.
Formula:Please Login or Register to view this content.
My General Rules if you want my help. Not aimed at any person in particular:
1. Please Make Requests not demands, none of us get paid here.
2. Check back on your post regularly. I will not return to a post after 4 days.
If it is not important to you then it definitely is not important to me.
If I may say, the attachment does not include too many additional details. Are there more requirements or limitations or scenarios? Are you required to perform the entire summation in a single cell formula, or are you open to other possibilities? What exactly is the logic behind the 900 results? As near as I can tell, it is simply the sum of the denominators/qty values (100+400+100+100+100+100), is that correct, or is there more to it?
Here's how I would probably approach something like this:
1) Text to columns to split the text string out and isolate the individual values into individual cells. Use delimited by comma "," and slash "/".
2) Then you can simply sum every other column, or use a SUMIF()/SUMIFS() function if you have a header row with size/qty.
Is that an approach you would be interested in?
Originally Posted by shg
Dear MrShorty,
Yes, I'm interested in split the text and use SUMIF()/SUMIFS() function
Please help to advise
Wie
Quick tutorial on using the Text to Columns command: http://www.excel-easy.com/examples/text-to-columns.html
Help file for the SUMIFS() function: https://support.office.com/en-us/art...6-611cebce642b
Put "size" into A1, "qty" in B1, then copy those two cells across as far as needed.
With delimited text in A2 (and down, if there is more than one row of data), execute text to columns.
In column to the right of parsed data, enter a SUMIFS() function. Maybe in AA2 =SUMIFS(A2:Z2,A$1:Z$1,"qty") Note the mix of relative and absolute references for easy copying down to additional rows.
Here's another possibility. In B2, copied across until 0s are returned:
=IFERROR(MID(TRIM(MID(SUBSTITUTE($A2,",",REPT(" ",100)),100*(COLUMNS($A:A)-1)+1,100)),FIND("/",TRIM(MID(SUBSTITUTE($A2,",",REPT(" ",100)),100*(COLUMNS($A:A)-1)+1,100)))+1,255)+0,0)
Then just add them up!
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.
Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh
This should give you the total of 900
Enter as regular formula
Formula:Please Login or Register to view this content.
The part {1,2,3,4,5,6} count of slashes in the string.
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Alkey... Only just brilliant. Truly the indisputable King of parsing!!!!
I have modified the above formula to make the count of slashes dynamic.
Formula:Please Login or Register to view this content.
Sorry, didn't see the attachment.
With the values in A1:A6 enter this Array Formula in B1 (enter with Ctrl+Shift+Enter)
Formula:Please Login or Register to view this content.
A B 1 2/100 900 2 3/400 3 5/100 4 6/100 5 7/100 6 8/100
Last edited by newdoverman; 12-30-2016 at 05:52 PM.
<---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.Ron W
=sumproduct(--(left(a1:f1,find("/",a1:f1)-1)))&"/"&sumproduct(--(replace(a1:f1,1,find("/",a1:f1),"")))
or can try below formula
Please Login or Register to view this content.
Samba
Say thanks to those who have helped you by clicking Add Reputation star.
Hi Alkey
Thanks for the lesson
But if you change A2 to 2/100,3/400,5/100,6/100,7/2, 8/7 your formula returns 715.
The only way I could get it to return 709 was modify it to:-
Entered using Ctrl Shift Enter:
Formula:Please Login or Register to view this content.
Please show me how it should be done.
Last edited by mehmetcik; 12-31-2016 at 06:06 PM.
Thankyou, Phuocam,
That is much nicer.
Dear Friends,
Thank you for your help. that solved my problem
Regards,
Wie
deleted wrong thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks