asked on # excel formula or VBA

I have two Columns in EXCEL

below are the scenarios i have to cover in the formula

I know this is little confusing I am attaching a sample file

How can i have formula or macro to do everythin in one column

sample1.xlsx

below are the scenarios i have to cover in the formula

- IF I have data in Col A that have to updated in Column D
- If I have Zero in Column A then do a vlookup based on Column C in Sheet2 and pick update results of column 5
- even after vlookup if i do not find anything Column D have to be updated with Column B
- in Column A if i have the rows contain FUSE DB then col B have to picked
- Delete Fuse db word in results column

I know this is little confusing I am attaching a sample file

How can i have formula or macro to do everythin in one column

sample1.xlsx

Microsoft ExcelVBA

Thank you so much, just few changes

1. If i get a result as "Fuse DB" in Col "D" then it have to be treated as blank

which means after execute the below formula and if stil get "Fuse DB" it have to cosider ""(Blank)

=IFERROR(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0),A2)

2. If my Column "D' is zero and Column Has "Fuse DB" only then this Formula if I have data in Columd then Col E have to be blank

=IF(A2="FUSE DB",B2,A2)

In a nut shell i either have to have data in Col D or Col E

1. If i get a result as "Fuse DB" in Col "D" then it have to be treated as blank

which means after execute the below formula and if stil get "Fuse DB" it have to cosider ""(Blank)

=IFERROR(VLOOKUP(C2,Sheet2

2. If my Column "D' is zero and Column Has "Fuse DB" only then this Formula if I have data in Columd then Col E have to be blank

=IF(A2="FUSE DB",B2,A2)

In a nut shell i either have to have data in Col D or Col E

For part 1, try

=IF(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0)="Fuse DB","",IFERROR(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0),A2)

for part 2, our description got a little confusing... can you elaborate on that.

I did notice that the 0 in column A is text, so the current formula in column C should have the 0 in quotes...

=IF(A2="0",C2,A2)

copied down.

=IF(VLOOKUP(C2,Sheet2!$A$2

for part 2, our description got a little confusing... can you elaborate on that.

I did notice that the 0 in column A is text, so the current formula in column C should have the 0 in quotes...

=IF(A2="0",C2,A2)

copied down.

for part 1 i am getting an error and i have attached file with changes highlighted in red. Hope I am clear. Thank you so much for your time

sample1.xlsx

View this solution by signing up for a free trial.

Members can start a 7-Day free trial and enjoy unlimited access to the platform.

and change G2 to:

=IF(A2="FUSE DB",B2,A2) to remove the #NA error

=IF(A2="FUSE DB",B2,A2) to remove the #NA error

Thank you so much. is there any way i can put it as a macro formula gets copy pasted based on the active cells in Col A?

=IFERROR(VLOOKUP(C2,Sheet2

copied down.

I think you are also talking about the formula in column D. It looks like you had and \ in the formula causing error:

s/b =IF(A2="FUSE DB",B2,A2)

Does this cover your request?