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
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,203
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,203
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
 

Watch MrExcel Video

Forum statistics

Threads
1,129,467
Messages
5,636,462
Members
416,919
Latest member
twc2c

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top