Skip to main content
incorporate comments in to the answer.
Source Link
rolfl
  • 97.5k
  • 17
  • 218
  • 418

In B1:

=if(upper(A1)="ADMIN","Exploitation","")

Then just fill it down. This is case insensitive.

This auto fill can be done two ways, either interactively in the worksheet, or programmatically:

Interactively: Excel has an autofill feature. With B1 selected and that formula put in, just double click the fill handle, which is the tiny square in the bottom right corner of cell when it's selected. Excel will intelligently copy the formula down to the end of the contiguous range that has data. Meaning if A1-A256 has data with no blanks, it'll autofill to B256. Alternatively, if there are blanks, scroll to the bottom and select B256 (or whatever the end is). Then Ctrl + Shift + Up arrow to select the range leading to B1, and Ctrl+D to copy it down (think d= ditto)

Using VBA... if you must do this programmatically: with the formula containing cell as your selection:

Selection.AutoFill Destination:=Range("B1:B19")

There's other options available for autofill to do a few cool tricks. Can copy a literal value instead of a formula, or also fill a series based on a pattern. You can also set custom patterns for it to recognize, such as lines of business you commonly repeat in stuff or cities you have retail locations in, etc.

In B1:

=if(upper(A1)="ADMIN","Exploitation","")

Then just fill it down. This is case insensitive.

In B1:

=if(upper(A1)="ADMIN","Exploitation","")

Then just fill it down. This is case insensitive.

This auto fill can be done two ways, either interactively in the worksheet, or programmatically:

Interactively: Excel has an autofill feature. With B1 selected and that formula put in, just double click the fill handle, which is the tiny square in the bottom right corner of cell when it's selected. Excel will intelligently copy the formula down to the end of the contiguous range that has data. Meaning if A1-A256 has data with no blanks, it'll autofill to B256. Alternatively, if there are blanks, scroll to the bottom and select B256 (or whatever the end is). Then Ctrl + Shift + Up arrow to select the range leading to B1, and Ctrl+D to copy it down (think d= ditto)

Using VBA... if you must do this programmatically: with the formula containing cell as your selection:

Selection.AutoFill Destination:=Range("B1:B19")

There's other options available for autofill to do a few cool tricks. Can copy a literal value instead of a formula, or also fill a series based on a pattern. You can also set custom patterns for it to recognize, such as lines of business you commonly repeat in stuff or cities you have retail locations in, etc.

Bounty Ended with 100 reputation awarded by RubberDuck
markdown.
Source Link
rolfl
  • 97.5k
  • 17
  • 218
  • 418

In B1: =if(upper(A1)="ADMIN","Exploitation","")

=if(upper(A1)="ADMIN","Exploitation","")

Then just fill it down. This is case insensitive.

In B1: =if(upper(A1)="ADMIN","Exploitation","")

Then just fill it down. This is case insensitive.

In B1:

=if(upper(A1)="ADMIN","Exploitation","")

Then just fill it down. This is case insensitive.

Source Link

In B1: =if(upper(A1)="ADMIN","Exploitation","")

Then just fill it down. This is case insensitive.