• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Get Year from Sheet Name, not Cell Reference|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Get Year from Sheet Name, not Cell Reference|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Get Year from Sheet Name, not Cell …
sp_PrintTopic sp_TopicIcon
Get Year from Sheet Name, not Cell Reference
Avatar
stephanrs
England/Humberside/Hull
Member
Members
Level 0
Forum Posts: 41
Member Since:
February 28, 2017
sp_UserOfflineSmall Offline
1
June 23, 2020 - 12:27 pm
sp_Permalink sp_Print

1st Date of Year using Tab Ref, not Cell Ref?

For example in Tab TOTAL Cell BF2:
=DATE(YEAR(BG2),1,1)

Hence how to substitute BG2 with TAB YEAR: 2020?

The cause reason is to automate Years Tabs Cell X39, which currently is manually edited date.

Cheers

Stephan

sp_AnswersTopicSeeAnswer See Answer
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1510
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
June 23, 2020 - 1:39 pm
sp_Permalink sp_Print

Hi Stephan,

I'm a bit confused about a few things.

BG2 is labelled 'Today's date' but you want to populate it with a year?

If so you can use a data validation list to choose the year you want to pull data from.

I don't understand why you are asking about cells on the Total sheet when you actually want to automate something on the years sheets.

On the years sheets, just have a cell with the year in it.  This can be referenced by other cells on the same sheet or by cells on other sheets.  I don't see that you need specific cells for the first and last date of the year as these are always Jan 1 and Dec 31.

Regards

Phil

Avatar
stephanrs
England/Humberside/Hull
Member
Members
Level 0
Forum Posts: 41
Member Since:
February 28, 2017
sp_UserOfflineSmall Offline
3
June 24, 2020 - 4:10 am
sp_Permalink sp_Print

Hi.

It is 1 only character which I won't overlook.

But what would a Formula look like that could use a tab name as the year?

It does sound trivial and like a great many things, I'm surprised I've not already had the need!

Start & End Date is so when next year comes along the calc won't keep rolling, so to speak.

 

I understand other ppl's work will seem beneath a specialised expert in XL, and guess you must wonder why ppl can't just google, but I don't know the Formula solution or likeky names, but thought the edit suggestion would be a gd start!

But not everything turns out good!

Cheers

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1510
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
June 24, 2020 - 9:01 am
sp_Permalink sp_Print

Not at all Stephan, we all learn by doing, reading, Googling etc.  I'm always looking stuff up, I can't remember the syntax for everything 🙂

You can get the name of the current sheet (where the formula resides) using a formula like this

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

So if you use this on Sheet1, it will return Sheet1.

You can get the name of another sheet, e.g. Sheet2, using this 

=MID(CELL("filename",Sheet2!A1),FIND("]",CELL("filename",Sheet2!A1))+1,255)

But you are including a reference to Sheet2 in that formula so that defeats the purpose as you know the name of the sheet you are trying to get.  You may as well just reference the sheet name directly.

Regards

Phil

Avatar
stephanrs
England/Humberside/Hull
Member
Members
Level 0
Forum Posts: 41
Member Since:
February 28, 2017
sp_UserOfflineSmall Offline
5
June 24, 2020 - 10:46 am
sp_Permalink sp_Print sp_EditHistory

Hi Phil

You are right direct edit of 1 cell 1 character once a year is no big deal!

But feel knowing the answer to this may prove useful in the future, for something else!

Hence maybe I'm asking the wrong question, how about:

WORKSHEET TAB NAME as FORMULA DATE (YEAR)?

Formula suggested:.
= MID(CELL("filename"), 1+SEARCH("]", CELL("filename")), 128)

But it can't be used here as:
1. Not recognised as Date & can't be custom formatted as date.
2. When used on other Worksheets in same Workbook, then unusual side effect, they all reference last worksheet tab formula was last edited/used in.
3. Perhaps this formula is still of use, if can be recognised as date format & "preceded" with:
01-01-YY (ie last 2 digits of worksheet name, they sorted it for the "Year 2000 Millennium Bug" into 4 digit to future proof but just 20th Century is my concern).

Guess somebody has knowledge of a Formula, to do this simple task as to preset Worksheet name as 4digit year as 1st day of that year in 6 digit layout?

Doesn't sound like Mission Impossible to me, I've just not seen it yet....

Hi Phil

You are right direct edit of 1 cell 1 character once a year is no big deal!

But feel knowing the answer to this may prove useful in the future, for something else!

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1510
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
6
June 24, 2020 - 1:17 pm
sp_Permalink sp_Print

Hi Stephan

MID returns a string so you need to use DATEVALUE to convert to a date

=DATEVALUE("1/1/"&MID(CELL("filename"), 1+SEARCH("]", CELL("filename")), 128))

Regards

Phil

sp_AnswersTopicAnswer
Answers Post
Avatar
stephanrs
England/Humberside/Hull
Member
Members
Level 0
Forum Posts: 41
Member Since:
February 28, 2017
sp_UserOfflineSmall Offline
7
June 25, 2020 - 4:03 am
sp_Permalink sp_Print

Hi Phil, Right I'll try those.....

& also hard to dodge the velocity of this the previous Formula did actually work, the Worksheet Tab name just needed formatting like a date:

01-01 etc

However I found the impact of this making the purpose of each tab more vague & harder to differentiate on 1st impression as all start the same way & wouldn't want the embarrassment & confusion of mixing up 1 year with another totally different year & doing wrong data entry, and not forgetting the anomaly of using same formula more then once on same workbook, hence will try above or just manual etc,

Avatar
stephanrs
England/Humberside/Hull
Member
Members
Level 0
Forum Posts: 41
Member Since:
February 28, 2017
sp_UserOfflineSmall Offline
8
June 25, 2020 - 9:52 am
sp_Permalink sp_Print

?? Same error! ??

I'll leave it in MANUAL EDIT for 1st DATE of YEAR, 01-01-YY, totally bullet proof.

Suggested formula have "ricochet" effect, error of duplicating last tab ref'd when used more then once in same workbook in different tabs, hence the opposite of the purpose for seperate totals per "calendar year". And to create defined names, of same formula will just to same unwanted domino effect.

If was sceptical surmise somebody had foreseen use of this & had created a finally anomaly to hinder/prevent "being organised".

Good job I make "backup" of files before working on them, ever such a familiar lifestory of trivial things turning into vast onerousities. If had not have learned from this ever such regular occurence, then would have wasted a lifetime reworking something that was better previously!

Was it like that before? Like that?
Etc 01-01

Thanks for your help, it is bullet proof now, manual edit of 1 character/number once a year it is!

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Tristram Sexton, David, Christopher Anderson
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
yashal minahil
Oluwadamilola Ogun
Yannik H
dectator mang
Francis Drouillard
Orlando Inocente
Jovitha Clemence
Maloxat Axmatovna
Ricardo Freitas
Marko Meglic
Forum Stats:
Groups: 3
Forums: 24
Topics: 6200
Posts: 27182

 

Member Stats:
Guest Posters: 49
Members: 31861
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.