• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to have excel automatically input pre-determined data into a cell?

d_7231

New Member
I need to have excel input an "X" in a cell, after a another cell has had data input in it.


For example, I need A1 to automatically display "X" after "XXX" has been manually input into B1.


However, I am not THAT fimilar with VBA or Macros so if there is a formula to input that would be preferable.


Thanks
 
d_7231


Firstly, Welcome to the Chandoo.org forums.


In A1 type

=If(B1="XXX","X","")
 
You can copy that down column A

Select A1

Drag the lower Right corner down

Excel adjusts the formula for each cell automagically
 
Thanks Hui.


But I don't necessarily need to copy the formula to a range of cells, but I need to include a range of cells into the formula so that if any cell B1:B10 are input with "XXX", then excel will automatically (OR automagically) input "X" into A1.


So...=IF(B1:B10="XXX","X","") for example...but I have already tried this and it came back with "#VALUE!"


Any thoughts?
 
in this case after entering formula don't just press enter, press Ctrl+Shift+Enter all together


or select the cell you have entered the formula >> press F2 >> press Ctrl+Shift+Enter all together
 
@shailyog


Thanks, but I could not get the array function to not work. It did not show a cell error anymore, but only B1 out of the range of B1:B10 worked correctly.


I need A1 to return "X" if "XXX" is entered into any cell B1 through B10.
 
We can do a COUNTIF to check if "XXX" appears within the specified range.

=IF(COUNTIF(B1:B10,"XXX"),"X","X")
 
@Luke M


You're awesome dude. Thanks! It worked except I modified the "logical_false" to "" to keep the cell blank if nothing is entered.


Appreciate everyone's help!
 
Back
Top