Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

excel formula or VBA

Posted on 2016-10-05
7
Medium Priority
?
64 Views
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
sample1.xlsx
0
Comment
Question by:Nirvana
[X]
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
7 Comments
 
LVL 23

Expert Comment

by:NBVC
ID: 41830021
Try in column A:

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

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?
0
 

Author Comment

by:Nirvana
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)

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

Expert Comment

by:NBVC
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...

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

copied down.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Nirvana
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
sample1.xlsx
0
 
LVL 23

Accepted Solution

by:
NBVC earned 2000 total points
ID: 41830463
Try:

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

Expert Comment

by:NBVC
ID: 41830468
and change G2 to:

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

Author Closing Comment

by:Nirvana
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?
0

Featured Post

Independent Software Vendors: 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

Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

610 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