Share via

If statement using Column Headers rather than cell references.

Anonymous
2016-08-25T13:35:52+00:00

I have the usual if statement (=IF(AND(K4="Yes",O4=100%),1,0)) however rather than reference the cell as K4 I want to reference by the column header.

Is this possible ?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-08-26T13:34:34+00:00

The @ means "For this row within the table"   So you want the entire column within the table:

=COUNTIFS(Table1[Contract Deliverable],"Yes")

And for the It is, if that is the entirety of the cell entry:

=COUNTIFS(Table1[Contract Deliverable],"It is")

Note that you don't need the = sign ever for the criteria argument. (You also don't need COUNTIFS if you have only one criteria, but it is OK to use it instead of COUNTIF.)

Was this answer helpful?

0 comments No comments

12 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-08-25T14:34:27+00:00

    Select your table, with the headers, and choose  Insert / Table

    Make sure you have "My table has headers" checked, then press OK

    Your range will be converted to a table:

    And when you reference cell K4, you will get the table-style reference:

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-08-25T14:21:09+00:00

    sounds good but not sure how

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-08-25T14:15:35+00:00

    BTW you do not need an IF for this.

    Try --AND(K4="Yes",O4=100%)  note the double negation before AND

    OR use (K4="Yes")*(O4=100%)

    best wishes

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-08-25T13:53:02+00:00

    If you convert your range to a table, then the formula will show the correct header reference when you re-enter the formula.  If you want to edit the formula, press F2, select the K4 in the formula and re-select K4 in the newly-defined table, and that will work too.

    Was this answer helpful?

    0 comments No comments