Increase numbers by 1

Yamasaki450

Board Regular
Joined
Oct 22, 2021
Messages
58
Office Version
  1. 2021
Platform
  1. Windows
Hello everyone.

I would like to increase multiple numbers in one cell by one... Any idea what would be the fastest way to do this? Is there any good add on to do this for multiple cells at once?

So in one cell i have numbers 6-2-54-109-7-9-3 and i would like to increase every number by 1 so the result would be 7-3-55-110-8-10-4

Picture
Clipboard02.png
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
In B4:
=TEXTJOIN("-",1,MID(TEXTSPLIT(A4,"-"),1,LEN(TEXTSPLIT(A4,"-")))+1)
 
Upvote 0
As the OP is using 2019, they won't have textsplit
 
Upvote 0
Hi,
You can use a UDF
VBA Code:
Function mycalc(rng As Range)
' in cell E4 just input = mycalc(A4)
Dim s
Dim i As Long
s = Split(rng, "-")
For i = LBound(s) To UBound(s)
    s(i) = s(i) + 1
Next i
mycalc = Join(s, "-")
End Function
 
Upvote 0
Another option
Excel Formula:
=TEXTJOIN("-",,FILTERXML("<k><m>"&SUBSTITUTE(A4,"-","</m><m>")&"</m></k>","//m")+1)
 
Upvote 1
Solution
Thanks guys but formulas dont work. I get error "there is a problem with this formula..." in both cases. What im doing wrong? And i dont know how to use VBA code is there tutorial for this? Sorry but im a bit new to this :) Can you help me out a bit more please. Thanks.
 

Attachments

  • Clipboard01.png
    Clipboard01.png
    76.1 KB · Views: 8
  • Clipboard03.png
    Clipboard03.png
    77.5 KB · Views: 9
Upvote 0
Sorry, my formula will not work as Fluff pointed out because you have Office 2019. My apology!
 
Upvote 0
Sorry, my formula will not work as Fluff pointed out because you have Office 2019. My apology!
NP. Thanks anyway. Which office version is this formula meant for? ill update office if i dont get another solution...
 
Upvote 0
Nevermind Fluffs method works i just had to replace commas with semicolons in formula and it works heh :) Thanks a lot guys you are awesome...
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,419
Messages
6,124,796
Members
449,189
Latest member
kristinh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top