Adding formula segments together

JDSOuth49

New Member
Joined
Feb 16, 2024
Messages
46
Office Version
  1. 365
Platform
  1. Windows
I am needing help with the following formula:

=IF(A65=Sheet1!A2,Sheet1!C2),or IF(A65=Sheet1!A3,Sheet1!C3),or IF(A65=Sheet1!A4,Sheet1!C4),or IF(A65=Sheet1!A5,Sheet1!C5)

The 1st segment works great, but not when the formula segments are added
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Perhaps
Excel Formula:
=INDEX(Sheet2!C2:C5,match(A65,Sheet1!A2:A5,0))
 
Upvote 0
One option is
Excel Formula:
=SWITCH(A65,Sheet1!A2,Sheet1!C2,Sheet1!A3,Sheet1!C3,Sheet1!A4,Sheet1!C4,Sheet1!A5,Sheet1!C5)

It looks like a continuous range so you can a VLOOKUP
Excel Formula:
=VLOOKUP(A65,Sheet1!$A$2:Sheet1!$C$5,3)

or XLOOKUP.
Excel Formula:
XLOOKUP(A65,Sheet1!$A$2:$A$5,Sheet1!$C$1:Sheet1!$C$5)
 
Upvote 0
Solution
One option is
Excel Formula:
=SWITCH(A65,Sheet1!A2,Sheet1!C2,Sheet1!A3,Sheet1!C3,Sheet1!A4,Sheet1!C4,Sheet1!A5,Sheet1!C5)

It looks like a continuous range so you can a VLOOKUP
Excel Formula:
=VLOOKUP(A65,Sheet1!$A$2:Sheet1!$C$5,3)

or XLOOKUP.
Excel Formula:
XLOOKUP(A65,Sheet1!$A$2:$A$5,Sheet1!$C$1:Sheet1!$C$5)
Worked great. Thank you.
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,641
Members
449,461
Latest member
kokoanutt

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
Back
Top