Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel function 'if true'

Status
Not open for further replies.

rhnaeco

Technical User
Aug 11, 2005
45
Hi all,

this is my data:
Range From To Sunrise Sunset
0.8 03:24 08:38 03:34:00 20:54:00
1 08:38 15:15 03:34:00 20:54:00
1.1 15:15 21:26 03:34:00 20:54:00
0.8 21:26 04:10 03:34:00 20:54:00
0.7 04:10 09:26 03:36:00 20:52:00 yes
0.9 09:26 16:06 03:36:00 20:52:00
0.9 16:06 22:18 03:36:00 20:52:00
0.7 22:18 05:20 03:36:00 20:52:00
0.6 05:20 10:28 03:37:00 20:51:00 yes
0.7 10:28 17:32 03:37:00 20:51:00 yes
0.7 17:32 23:28 03:37:00 20:51:00
0.6 23:28 06:56 03:37:00 20:51:00
0.5 06:56 12:01 03:39:00 20:49:00 yes



the last column is the result of a conditional formula using data from the previous columns.

at the moment I copy and paste all the columns and sort by the last column (yes) so i know when all the conditions are met and it's all in one table. I would like to do this a bit more automatically so can i get some function that does:

if M3 = "yes" then print columns I3, J3, K3, L3, M3

so i have:
0.7 04:10 09:26 03:36:00 20:52:00 yes
0.6 05:20 10:28 03:37:00 20:51:00 yes
0.7 10:28 17:32 03:37:00 20:51:00 yes
0.5 06:56 12:01 03:39:00 20:49:00 yes

without having to manually sort. I would like to avoid vba because i have no idea how to use it.

thanks in advance
 

Hi,

I would like to avoid vba because i have no idea how to use it.
You could hope alot, or record a macro.

I would not SORT. Rather use the AutoFilter.

1) Select in the table.

2) Data > Filter - AutoFilter (now your AutoFilter is active in this table until you decide to deactivate it the same way you activated it.

3) Turn on your macro recorder Tools > Macro > Record new macro in This Workbook

4) Select "yes" in column F filter

5) Print

6) Select the column F filter and Show (All)

7) Turn off the macro recorder.

If you want more help for macros (VBA) post your questions in Forum707.


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top