If Else Formula Add

VaYooper

New Member
Joined
Mar 12, 2015
Messages
31
Hello.. I'm trying to figure out how to add a formula in 'Division Code' column that would vary based on the value in the 'Program' column. For example, if under 'Program' it contains either WH or ARM input this formula under Division code
VBA Code:
=IF(ISERROR(VLOOKUP(H2,'Echelon Table'!A:B,2,FALSE))," ",VLOOKUP(H2,'Echelon Table'!A:B,2,FALSE))
if under Program' it contains PA then use this code
VBA Code:
=IF(ISERROR(VLOOKUP(E3,'PA Extract'!E:G,3,FALSE))," ",VLOOKUP(E3,'PA Extract'!E:G,3,FALSE))
Trying to intertwine else statements and formulas always seems to confuse me. Thank you in advance


ID NumberProgramGroup CodeGroup CategoryControl NumberDept CodeDivision CodeGroup
5110001622205WHB0000000000001132677GROUP 2
5110001622205ARMB0000000000001132677GROUP 2
5110001622205ARMB0000000000001132677GROUP 1
5110001867107WHD76302CHISELB0000000000001129817GROUP 3
5110001867107WHD76302CHISELB0000000000001129817GROUP 3
5110001867107PAD76302CHISELB0000000000001129817GROUP 3
5110001867107WHD76302CHISELB0000000000001129817GROUP 3
5110001867107PAD76302CHISELB0000000000001129817GROUP 3
 
Last edited:

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Nothing in your post to say which column the 'Program' is in so I've assumed column B

=IF(OR(B2="WH",B2="ARM"),IFERROR(VLOOKUP(H2,'Echelon Table'!A:B,2,FALSE),""),IFERROR(VLOOKUP(E2,'PA Extract'!E:G,3,FALSE),""))
 
Upvote 0
Nothing in your post to say which column the 'Program' is in so I've assumed column B

=IF(OR(B2="WH",B2="ARM"),IFERROR(VLOOKUP(H2,'Echelon Table'!A:B,2,FALSE),""),IFERROR(VLOOKUP(E2,'PA Extract'!E:G,3,FALSE),""))


Sorry about that. Yes it is in column B as assumed. You formula works beautifully Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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