# Applying an IF formula to an entire Column?

##### New Member
Hey guys I have a project I am doing, but I have so many people who joined I was wondering if it there is a way to assign a formula to an entire Column?

For example:
I have a row with the following data:
 1 W L T L T L W W

<tbody>
</tbody>

Lets say I have around 500 of these rows with the data random.

I want to assign a formula to the columns for example column B:
If the column B has Value "W" assign it to 1 if not 0.

Also is there a way I can once I apply those formulas. How do I add those new values at the end on a new column?

Thanks for the Help I'm new to Excel and any help would be appreciated.

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try in B502=COUNTIF(B1:B500,"W")
If you want more flexibility you can put "W" in a cell somewhere and refer to the cell

Try in B502=COUNTIF(B1:B500,"W")
If you want more flexibility you can put "W" in a cell somewhere and refer to the cell

Okay that seemed to work! How would I make it so if I made a new column to add the numbers now?

Your question isn't clear to me.
If you want to count "W" in two different columns, with the result in the same cell then

If the columns are adjacent and you only want to count "W" =COUNTIF(B1:C500,"W")
or if they are not adjacent then COUNTIF(B1:B500,"W")+COUNTIF(K1:K500,"W")
or if you want "W" in one column and "X" in anther
COUNTIF(B1:B500,"W")+COUNTIF(K1:K500,"X")

Just re-read your posting...maybe you just need to copy from B502 and paste in row 502 of another column???

Replies
8
Views
280
Replies
1
Views
108
Replies
15
Views
320
Replies
1
Views
115
Replies
2
Views
127

1,196,438
Messages
6,015,277
Members
441,885
Latest member
Gop

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back