+ Reply to Thread
Results 1 to 8 of 8

Assign value to other cell

  1. #1
    Registered User
    Join Date
    10-17-2020
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Post Assign value to other cell

    How does one assign a value to another spreadsheet cell ?
    I'm trying to assign "YES" or "NO" to cell B2 depending on the content of cell A1:
    IF(A1="",ASSIGN(B2,"YES"),ASSIGN(B2,"NO"))
    where ASSIGN is the function I'm looking for.
    I'd appreciate your help with this as this seems a basic functionality
    but I have not found a solution (on the Web) yet.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    35,973

    Re: Assign value to other cell

    There's no such function as Assign in Excel. You put the formula itself into cell B2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-17-2020
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: Assign value to other cell

    Thanks for your reply, TMS.

    I should elaborate with the complete situation:
    I'm trying to copy data from column B into column A ONLY if a cell in column A is empty.
    And would like to accomplish:
    {cell C2} =IF(A2="",ASSIGN(A2,B2),)
    and then copy this formula down column C.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    11,743

    Re: Assign value to other cell

    How about
    =IF(A2="",B2,A2)
    or maybe
    =IF(A2="",B2,"")

  5. #5
    Registered User
    Join Date
    10-17-2020
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: Assign value to other cell

    Thanks for your reply, Fluff !

    That works, but puts the result in column C in stead of column A.
    One would then have to copy column C onto column A to complete the action.

    I have a feeling that it is somehow not possible / allowed to change the value of another cell using a function.
    I'm eager to learn if, and if so, why that is, as assigning values to cells is trivial in VBA.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    35,973

    Re: Assign value to other cell

    No, you cannot change another cell with a function/formula in a cell.

    Any cell can contain a value or a formula, but not both. So, a formula can change its value dependant on another cell, or cells, but it cannot "assign" a value to another cell.

  7. #7
    Registered User
    Join Date
    10-17-2020
    Location
    USA
    MS-Off Ver
    2007
    Posts
    7

    Re: Assign value to other cell

    Thanks for sharing your insight, TMS !

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    35,973

    Re: Assign value to other cell

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Assign fixed value to blank cell if adjacent cell is populated.
    By Eric P. in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-15-2015, 08:36 AM
  2. [SOLVED] How to take cell with custom format and assign to variable as text (as appears in cell)
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-07-2014, 02:44 PM
  3. Create Auto-Calculating Cell and Assign Cell Values Based on a Macro
    By Titanium Fox in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2013, 12:00 AM
  4. Replies: 3
    Last Post: 04-23-2013, 03:46 PM
  5. Script to insert a checkbox into every cell in a column and assign it to that cell
    By clintonwarren in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2012, 02:14 PM
  6. Replies: 3
    Last Post: 08-13-2012, 01:03 AM
  7. Assign active cell in macro with Dynamic Cell choice
    By scaffdog845 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2009, 03:58 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1