excel formula or VBA

Posted on 2016-10-05
Last Modified: 2016-10-06
I have two Columns in EXCEL

below are the scenarios i have to cover in the formula
  1. IF I have data in Col A that have to updated in Column D
  2. If I have Zero in Column A then do a vlookup based on Column C in Sheet2 and pick update results of column 5
  3. even after vlookup if i do not find anything Column D have to be updated with Column B
  4. in Column A if i have the rows contain FUSE DB then col B have to picked
  5. 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
Question by:Nirvana
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 23

Expert Comment

ID: 41830021
Try in column A:


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?

Author Comment

ID: 41830313
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)


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
LVL 23

Expert Comment

ID: 41830396
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...


copied down.
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.


Author Comment

ID: 41830432
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
LVL 23

Accepted Solution

NBVC earned 500 total points
ID: 41830463

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

Expert Comment

ID: 41830468
and change G2 to:

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

Author Closing Comment

ID: 41831356
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?

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question