# If then

#### PlzHelpMe

##### New Member
Hello everyone, hoping one of you smart people can help with my conundrum. I'm using the formula below as an "if then," but getting an error (Invalid Name) every time. Basically I want to return one index/match if cell A2 is "Late" or another index/match if A2 is "Early." Please help me...

=IF(A2=Early, (INDEX(Data!\$B\$2:\$K\$21, MATCH("Average",Data!\$C\$2:\$C\$21,), MATCH("Cure Per Connect",Data!\$B\$2:\$K\$2,))), IF(A2=Late, (INDEX(Data!\$B\$2:\$K\$21, MATCH("Late",Data!\$C\$2:\$C\$21,), MATCH("Cure Per Connect",Data!\$B\$2:\$K\$2,0)))))

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Unless those are named ranges or named constants, they need to be in quotes:

Code:
``````=IF(A2="Early", INDEX(Data!\$B\$2:\$K\$21, MATCH("Average", Data!\$C\$2:\$C\$21, 0), MATCH("Cure Per Connect", Data!\$B\$2:\$K\$2, 0)),
IF(A2="Late",  INDEX(Data!\$B\$2:\$K\$21, MATCH("Late",    Data!\$C\$2:\$C\$21, 0), MATCH("Cure Per Connect", Data!\$B\$2:\$K\$2, 0))))``````

Works perfectly! Thank you for your help. Make it a great day!

You're welcome.

Replies
1
Views
332
Replies
3
Views
180
Replies
2
Views
414
Replies
7
Views
431
Replies
3
Views
274

1,203,553
Messages
6,056,063
Members
444,841
Latest member
SF_Marnie

### 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.

### Which adblocker are you using?

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

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