Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2017, 11:41 PM
Cyberseeker Cyberseeker is offline Sum within a single Cell? Windows 10 Sum within a single Cell? Office 2010 32bit
Advanced Beginner
Sum within a single Cell?
 
Join Date: Jun 2016
Posts: 44
Cyberseeker is on a distinguished road
Default Sum within a single Cell?

This may sound a little odd, but I would like a single cell to display two figures in the following format: + 19 + 1 Both plus (+) signs need to be displayed.

Then, in an adjacent cell I would like to sum the first cell and divide it thus: =B69/4 The answer in this hypothetical example should be "5", but no plus sign should appear in this case.

My efforts today give me a result of, "#value" Can I get it to do what I want?



Thanks for any help.
Reply With Quote
  #2  
Old 01-13-2017, 12:58 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Sum within a single Cell? Windows 7 64bit Sum within a single Cell? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

As the two figures in one cell constitute a text string, VBA will probably be needed.
What are you trying to do?
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 01-13-2017, 08:07 AM
Cyberseeker Cyberseeker is offline Sum within a single Cell? Windows 10 Sum within a single Cell? Office 2010 32bit
Advanced Beginner
Sum within a single Cell?
 
Join Date: Jun 2016
Posts: 44
Cyberseeker is on a distinguished road
Default

Yes, I do want it to read like text, but I also want it to sum in another column. If VBA is simply achieved I might give it a go, but if it's too complicated I may have to just write the answer manually.
Reply With Quote
  #4  
Old 01-13-2017, 08:46 AM
jeffreybrown jeffreybrown is offline Sum within a single Cell? Windows Vista Sum within a single Cell? Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Maybe, with + 19 + 1 in A1...

=SUM((TRIM(MID(SUBSTITUTE(A1,"+",REPT(" ",255)),1+(ROW(A1:A200)-1)*255,255)) & "0")/10)

IMPORTANT
  • This is an array formula
  • Enter the formula >> press F2 then >> CTRL + SHIFT + ENTER
  • If entered correctly, the formula will be enclosed in {brackets}
  • Do not enter the {brackets} manually
Reply With Quote
  #5  
Old 01-13-2017, 10:26 AM
Cyberseeker Cyberseeker is offline Sum within a single Cell? Windows 10 Sum within a single Cell? Office 2010 32bit
Advanced Beginner
Sum within a single Cell?
 
Join Date: Jun 2016
Posts: 44
Cyberseeker is on a distinguished road
Default

That worked well Jeffrey, but I omitted mentioning in the opening post that I wanted to add another cell at the same time. So, I inserted it into your code as follows:


Code:
=(SUM((TRIM(MID(SUBSTITUTE(B75,"+",REPT(" ",255)),1+(ROW(A1:A200)-1)*255,255)) & "0")/10)+SUM((TRIM(MID(SUBSTITUTE(B76,"+",REPT(" ",255)),1+(ROW(A1:A200)-1)*255,255)) & "0")/10))/29.5306
I suspect that my code is unnecessarily longwinded because there are two numbers in the first cell but the second cell only contains one figure. Can you condense it for me?

Incidentally, my project relates to a soli-lunar calendar.
Reply With Quote
  #6  
Old 01-13-2017, 02:02 PM
jeffreybrown jeffreybrown is offline Sum within a single Cell? Windows Vista Sum within a single Cell? Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Please provide what exactly is in B75 and what is in B76!

Also, what do you expect as the answer?

My thought, use the formula provided for answers in two separate cells and then as an example...

=(C75+C76)/29.5306

If there is only one number in B76, then not sure we need the first formula, but once you tell us what is in B76 then we can get something to work.
Reply With Quote
  #7  
Old 01-13-2017, 09:11 PM
Cyberseeker Cyberseeker is offline Sum within a single Cell? Windows 10 Sum within a single Cell? Office 2010 32bit
Advanced Beginner
Sum within a single Cell?
 
Join Date: Jun 2016
Posts: 44
Cyberseeker is on a distinguished road
Default

B75 reads "+1279 + 1"
B76 reads "+1290"

F75 should read "87 months" in other words, 1279 days, plus 1 day, plus 1290 days equals 2570 days. Divide that by a lunar month (29.5306 days) equals 87.0284 months.

I have custom formatted F75 to leave out the decimal points and to place "87 months" but I cannot automatically add up to 87.

Also, I need to fill down the "F" column so that this formula keeps repeating adjacent to its respective cells in "B" column.
Reply With Quote
  #8  
Old 01-14-2017, 07:09 AM
jeffreybrown jeffreybrown is offline Sum within a single Cell? Windows Vista Sum within a single Cell? Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Try...

Code:
       ----B---- C D E ----F----
  75   +1279 + 1       87 Months
  76   +1290
F75 =(SUM((TRIM(MID(SUBSTITUTE(B75,"+",REPT(" ",255)),1+(ROW($A$1:$A$200)-1)*255,255)) & "0")/10)+(B76+0))/29.5306

IMPORTANT
  • This is an array formula
  • Enter the formula >> press F2 then >> CTRL + SHIFT + ENTER
  • If entered correctly, the formula will be enclosed in {brackets}
  • Do not enter the {brackets} manually

Custom Format >> F75
  • Right click cell (or Ctrl + 1)
  • Format Cells
  • Number
  • Custom
  • Type: 0" Months"

Quote:
Also, I need to fill down the "F" column so that this formula keeps repeating adjacent to its respective cells in "B" column.
If the current values are in B75 and B76 with the result in F75, where are the next values, B77 and B78?

If so, you can just copy F75 and paste into F77.

How far down do you need to copy? How many results did you need?
Reply With Quote
  #9  
Old 01-14-2017, 10:18 AM
Cyberseeker Cyberseeker is offline Sum within a single Cell? Windows 10 Sum within a single Cell? Office 2010 32bit
Advanced Beginner
Sum within a single Cell?
 
Join Date: Jun 2016
Posts: 44
Cyberseeker is on a distinguished road
Default

Quote:
Originally Posted by jeffreybrown
If the current values are in B75 and B76 with the result in F75, where are the next values, B77 and B78?
B78 and B79 (B77 is missed out)

Quote:
Originally Posted by jeffreybrown
How far down do you need to copy? How many results did you need?
Its open-ended, however Ill probably stop at 210 results.

Thanks for your good help. I have filled down for 50 results and it works like a charm.
Reply With Quote
  #10  
Old 01-14-2017, 10:50 AM
jeffreybrown jeffreybrown is offline Sum within a single Cell? Windows Vista Sum within a single Cell? Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

You are most welcome and thanks for the feedback.

If you are going to have about 210 instances of the formula, you should adjust...

ROW($A$1:$A$200) >> to >> ROW($A$1:$A$300)

300 just puts you on the safe side.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum within a single Cell? Combining several cells data into one single cell H28Sailor Excel 6 01-09-2017 06:00 AM
Sum within a single Cell? Sum values within a single cell shabbaranks Excel 17 05-13-2014 06:47 PM
Sum within a single Cell? How to count multiple values in a single cell, except zero? iuliandonici Excel 1 04-13-2011 09:45 PM
Sum within a single Cell? Sum & difference between multiple values in a single cell iuliandonici Excel 4 04-13-2011 09:27 PM
Sum within a single Cell? How can I write the following (whole) formula in a single cell? Learner7 Excel 1 07-19-2010 10:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft