Formula to delete rows based on "Answer: ?"

blahbleh

New Member
Joined
Feb 20, 2017
Messages
2
Hi I almost gave up searching when I registered to post this question. Please help me.

I have these rows for example:
[TABLE="width: 658"]
<tbody>[TR]
[TD]2) What are profits?[/TD]
[/TR]
[TR]
[TD]A) Total money taken in by a corporation[/TD]
[/TR]
[TR]
[TD]B) Increases in income from year to year[/TD]
[/TR]
[TR]
[TD]C) Increases in a corporation's stock price[/TD]
[/TR]
[TR]
[TD]D) Revenue generated by goods and services[/TD]
[/TR]
[TR]
[TD]E) Difference between revenues and expenses[/TD]
[/TR]
[TR]
[TD]Answer: E[/TD]
[/TR]
</tbody>[/TABLE]

What I am trying to do here is to find a formula that deletes all the rows that are not the correct answer,above the last row, which contains the correct answer. This is where I got so far and it could be a completely incorrect approach.

=IF(A11=Answer: a, FIND("A) *",A6))

Best scenario it deletes even the answer row after it finished searching.

Thank you
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Formulas cannot delete rows.
Formulas can produce a value based on other cells but there is no formula to delete a cell.
You need VBA to delete cells/rows.

You could use Condtional Formatting to highlight the row with the correct answer. To do this you would need some form of table that contained a list of questions and their correct answers.
But it still wouldnt delete the wrong rows.
 
Last edited:
Upvote 0
Formulas cannot delete rows.
Formulas can produce a value based on other cells but there is no formula to delete a cell.
You need VBA to delete cells/rows.

You could use Condtional Formatting to highlight the row with the correct answer. To do this you would need some form of table that contained a list of questions and their correct answers.
But it still wouldnt delete the wrong rows.



I appreciate your time Special-K99!
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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