Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Updating the months on expenditure sheet in Numbers

I think this is pretty easy to answer, however, I have not found a tutorial.


I have recently created an expenditure sheet in Numbers and the majority of the items are standard (i.e. they appear every month).


Due to this, I have simply been copying and pasting an existing month and updating the dates in the columns one by one, by using find and replace. However, this is a very tedious and manual exercise.


I'm sure there must be a smarter more productive way to do this.


Please advise.


Cheers

MacBook Pro (2020 and later)

Posted on Aug 8, 2021 7:00 PM

Reply
Question marked as Best reply

Posted on Aug 9, 2021 10:28 AM

If all you want to do is "advance" the dates by a month then you could try these approaches...


Via formula


Use the EDATE function. If the original date is in A2 then the formula would be =EDATE(A2,1).


Each time you could set up and extra column and insert the formula in it. Then to "remove" the formulas you would select the cells, command-c, Edit > Paste Formula Results. Copy paste that on to the original dates and delete the extra column.


Via Script


Another way is via script. This doesn't require knowledge of AppleScript, just the ability to copy-paste, select, and click:


  1. Copy-paste script into Script Editor (in Applications > Utilities).
  2. Select the cells.
  3. Click the triangle <run> button in Script Editor.


If "nothing happens" make sure Script Editor is listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.


SG


The script:


tell front document of application "Numbers"
	tell active sheet
		tell (first table whose class of selection range is range)
			repeat with c in cells of (get selection range)
				tell c
					set theDate to value - (time to GMT)
					set {year:y, month:m, day:d} to theDate
					if m + 1 = 13 then set y to y + 1
					set m to (m + 1) mod 12
					set month of theDate to m
					set year of theDate to y
					set value of c to theDate
				end tell
			end repeat
		end tell
	end tell
end tell

Similar questions

7 replies
Question marked as Best reply

Aug 9, 2021 10:28 AM in response to Tommisauce

If all you want to do is "advance" the dates by a month then you could try these approaches...


Via formula


Use the EDATE function. If the original date is in A2 then the formula would be =EDATE(A2,1).


Each time you could set up and extra column and insert the formula in it. Then to "remove" the formulas you would select the cells, command-c, Edit > Paste Formula Results. Copy paste that on to the original dates and delete the extra column.


Via Script


Another way is via script. This doesn't require knowledge of AppleScript, just the ability to copy-paste, select, and click:


  1. Copy-paste script into Script Editor (in Applications > Utilities).
  2. Select the cells.
  3. Click the triangle <run> button in Script Editor.


If "nothing happens" make sure Script Editor is listed and checked at System Preferences > Security & Privacy > Privacy > Accessibility.


SG


The script:


tell front document of application "Numbers"
	tell active sheet
		tell (first table whose class of selection range is range)
			repeat with c in cells of (get selection range)
				tell c
					set theDate to value - (time to GMT)
					set {year:y, month:m, day:d} to theDate
					if m + 1 = 13 then set y to y + 1
					set m to (m + 1) mod 12
					set month of theDate to m
					set year of theDate to y
					set value of c to theDate
				end tell
			end repeat
		end tell
	end tell
end tell

Aug 9, 2021 4:11 AM in response to Barry

Hi Barry,


I am using a single table to record all my expenditures. I've looked at the Personal Budget template, that one is nice and simple however my expenditure sheet has 20+ categories.


I've taken another screenshot - so this might be more helpful.


So we are clear, the expenses each month do change, however, around 60 -70% are repeat expenses - hence I just duplicate the months.


Thanks again

T


Aug 8, 2021 10:15 PM in response to Tommisauce

Hi Tommisauce,


Are you recording each months expenses on a separate table? Do you have days on which there are more than one expense to be recorded, and days on which you do not incur any recordable expenses?


Generally, it is more efficient to record all transactions on a single table, then extract and summarize those expenses for each month using a set of Summary tables.


The Personal Budget template in the Template Choser can be viewed as an example of this type of document.


While you are taking a look at that, I, and I'm sure SGIII would still like to see a screenshot of your existing table to give us a better view of the overall situation and issues.


After you've taken the screen shot, followng SG's instructions, click the 'two mountains' icon second from th right in the row of buttons below the composition pane to tke you to your Desktop, where you'll find the image file named 'Screen shot' followed by the date and time which you took the shot. Double click the file or click once to select it then click Choose to choose it to get back to your post, where the image will arrive after a few seconds.


With the image in place, you can continue entering your message, or click Post to post you message including the screen chot.


Regards,

Brry

Updating the months on expenditure sheet in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.