I have an IF formula to return column heading for FALSE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an IF formula that returns " " when logic is TRUE, but I wish it to
return the column heading for the FALSE logic. What is the formula for the
FALSE logic, please?
 
Is the column heading in a cell? Is so, just have the false logic be the
cell with the header in.
 
Is the column heading just a cell where you've typed the header?

If yes:

=if(something,"",A1)

Where A1 holds that header.
 
The formula I currently have is

=IF((COUNTIF(H2:U2,">="&E2)-COUNTIF(H2:U2,">="&F2))=0," ","Due")

I wish to replace the word "Due" with whichever column heading is the result.
 
I don't see anything that describes how the result is obtained.
 
The formula determines if any of the dates in the range of H2:U2 are between
the dates in cells E2 and F2, and if not the cell remains blank. If there is
a date in that range that is between the dates in E2 and F2 the cell is given
the word Due. Rather than the word Due, I want an equation that will find
the date and then return to the cell the column header of that cell.
 
Assuming the headers are in H1:U1, how about:

=IF((COUNTIF(H2:U2,">="&E2)-COUNTIF(H2:U2,">="&F2))=0,"",
INDEX(H1:U1,MATCH(1,(H2:U2>=E2)*(H2:U2<=F2),0)))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

ps. I changed your " " to "", too.

I also included the end dates with >= and <=. Did you want them included?

The formula determines if any of the dates in the range of H2:U2 are between
the dates in cells E2 and F2, and if not the cell remains blank. If there is
a date in that range that is between the dates in E2 and F2 the cell is given
the word Due. Rather than the word Due, I want an equation that will find
the date and then return to the cell the column header of that cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top