Issue with multiple conditions and column()

lovallee

Board Regular
Joined
Jul 8, 2002
Messages
216
Hello,

I am using the following array formula (confirmed with CTRL+SHIFT+ENTER), the result of which will be used in another OFFSET() formula. The formula is intented to return a column number based on two conditions.

However, the formula always return 0.

=IF($C$1:$AV$10="Balance",IF($C$1:$AV$10="USD",COLUMN($A$1:$AV$10),),)

Any ideas why it fails?

Thank you.

Louis
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
Hello,

I am using the following array formula (confirmed with CTRL+SHIFT+ENTER), the result of which will be used in another OFFSET() formula. The formula is intented to return a column number based on two conditions.

However, the formula always return 0.

=IF($C$1:$AV$10="Balance",IF($C$1:$AV$10="USD",COLUMN($A$1:$AV$10),),)

Any ideas why it fails?

Thank you.

Louis
Suppose that:

C2 = Balannce

and

F2 = USD

What result are you expecting to return?
 

lovallee

Board Regular
Joined
Jul 8, 2002
Messages
216
Oupss I made a small error copying the array formula:
=IF($C$10:$AV$10="Balance",IF($C$11:$AV$11="USD",COLUMN($A$1:$AV$1),),)

Suppose that:
C10 = Balance
D10 = Balance
E10 = Movement
and
C11 = CAD
D11 = USD
E11 = USD

I would expect the fomula to return 4, which is the first column number that meets both conditions. Currently, the formula always returns 0 so there is something that I don't understand...
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
Oupss I made a small error copying the array formula:
=IF($C$10:$AV$10="Balance",IF($C$11:$AV$11="USD",COLUMN($A$1:$AV$1),),)

Suppose that:
C10 = Balance
D10 = Balance
E10 = Movement
and
C11 = CAD
D11 = USD
E11 = USD

I would expect the fomula to return 4, which is the first column number that meets both conditions. Currently, the formula always returns 0 so there is something that I don't understand...
Control+shift+enter, not just enter:

=MIN(IF($C$10:$AV$10="Balance",IF($C$11:$AV$11="USD",COLUMN($C$10:$AV$10))))
 

lovallee

Board Regular
Joined
Jul 8, 2002
Messages
216
Re: Issue with multiple conditions and column() - SOLVED

Thank you very much Aladin.

Now I understand.

1) Removing the "value_if_false" argument of the IF functions inserts FALSE values rather than zeros in the resulting array (i.e. {FALSE, 4, FALSE, ...} rather than {0, 4, 0, ...}

2) The MIN function extracts the value "4" from the resulting array {FALSE, 4, FALSE, ...}.


Kind regards Aladin,

Louis
 

Forum statistics

Threads
1,081,909
Messages
5,362,016
Members
400,667
Latest member
cryptomike

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top