Nested IF function?

jimonfly

New Member
Joined
May 7, 2011
Messages
21
I am trying to hide rows in a sheet once the end of data is reached. I have code already setup to hide the row if Column A contains "H". The end of data is marked by the data in Column E being "Percent of Total Expiring". In column A I have the following formula so if the Column E data is blank or text, it returns "S" for show the row. When the logical_test is met it returns "X" to signify the end of data.

=IF(E19="Percent Of Total Expiring","X","S")

(E19 just happens to contain "Percent Of Total Expiring" on the table I am working with)

I want to amend this formula so if the cell above (in Column A) contains "X" or "H", then the cell value will be "H". This should result in Column A containing "S" above the logical_test, "X" for the logical_test, and "H" for everything below. The VBA code will then hide all the "H" rows and I will have a nice looking table.

Can someone help, please?

Jim
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Jim

Try -

Code:
=IF(E19="Percent Of Total Expiring","X",IF(OR(OFFSET(A19,-1,,1,1)="H",OFFSET(A19,-1,,1,1)="X"),"H","S"))

hth
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,266
Members
452,902
Latest member
Knuddeluff

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