Share via

How to solve #VALUE! Error when using Cell("filename")?

Anonymous
2018-11-01T07:29:00+00:00

Hello,

I cannot get the filename by cell function using cell("filename"). It says "A value used in the formula is of the wrong data type." I did not assign any data types to cells. I also tried with referencing (cell("filename";A1))

I can use cell function for other features like col.

How can I solve this?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Vijay A. Verma 104.8K Reputation points Volunteer Moderator
2018-11-01T08:16:54+00:00

Can you try using CELL("FILENAME";A1) in your formula? This issue has been reported for Turkish version of Excel where the above workaround was recommended. All arguments of CELL were working except filename. This might be a problem in few other non English versions of Excel.

Source - https://social.msdn.microsoft.com/Forums/office...

Was this answer helpful?

8 people found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2018-11-01T08:16:17+00:00

    There are 2 possible reasons for the problem:

    a) The file is stored in OneDrive or Sharepoint

    b) Your Excel language is not English

    I suggest to use an UDF

    Function SheetName(ByVal Cell As Range) As String
      SheetName = Cell.Parent.Name
    End Function
    

    Call with a formula

    =SheetName(A1)

    Andreas.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-11-01T07:55:35+00:00

    Hello,

    I just want a cell that shows sheet name for the sheet its on. 

    I want this to be automated:

    I was trying to use a formula I found online:

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

    Error occurs on cell function. 

    Filename is irrelevant for me, if there is a more direct solution to get sheet name I would use it

    Thank you,

    Was this answer helpful?

    0 comments No comments
  4. DaveM121 886.7K Reputation points Independent Advisor
    2018-11-01T07:36:33+00:00

    Hi Volkan

    May I ask, are you trying to get data from another Excel spreadsheet by referencing a file name in a cell?

    If so, in that cell have you declared the correct path to that Workbook and also a sheet on that Workbook?

    Please provide the text from that cell so I can check that is formatted correctly . . .

    Was this answer helpful?

    0 comments No comments