Problems with IF function, unable to use column selection

Copper Contributor

Hello,

I have to complete an assignment using Excel for my online class and the class wants me to use a very specific formula inorder to fill the table.

The textbook wants me to use this formula:

=IF([@[Specialty]=“Loans”, [@[Account Values]]*.0025,0)

the assignment says to enter the [then double click the column from the drop down list to select the appropriate column for the formula. When I attempt to do this it doesn't put the column title Specialty or Account values into the formula its just inserts Column 3 and Column 4 respectively. When I hit enter it gives me a syntax error. When I directly copy paste the formula into the excel from my textbook it gives me a syntax error. I tried playing with the selection and instead of selecting the column I selected the cells and no matter what I do I only get Syntax errors, #Name?, and #Spill! errors. I can't figure out how to fix this. I tried looking online at other support forums and the people there were just saying to make a whole new workbook/table which is not an option as this excel file is provided by the textbook and I can't just make my own. 

Please help.

1 Reply

@RRouse34 I wouldn't be able to follow that instruction either as it is wrong. You are obviously learning about how to use structured table reference. What you do is the following:

 

First make sure that you have a structured table with a column called Specialty and another called Account Values.

In the cell (usually on the first row below the headers) in another (empty) column in the table, start typing =IF( and point at the cell on the same row in the Specialty column. That will automatically insert [@Specialty].

(Note that there is one square bracket too many in the textbook formula). Continue typing the formula and when you come to entering the reference for the account value, just click on the correct cell and [@[Account Values]] will be added. Finish typing the formula and press enter. 

 

You should end up with this, down the entire column:

=IF([@Specialty]=“Loans”, [@[Account Values]]*0.0025,0)

 

The extra inner set of square brackets is only needed when the column name includes special characters (like a space). That's why the reference to Account Values looks different than the one for Specialty.

 

The @ sign indicates that you are looking at a value on the same row as where the formula is entered. If you address an entire column in a formula within a structured table you get the SPILL error as it is not allowed.