[Solved] Using Arrays to List Specific Data

Discuss the spreadsheet application
Post Reply
Robitron
Posts: 105
Joined: Thu Nov 15, 2012 5:27 pm

[Solved] Using Arrays to List Specific Data

Post by Robitron »

Okay, so I need to write a formula that will list only data on a spreadsheet that meets certain criteria. Example:

Cells A1:A10 = Dates
Cells B1:B10 = Times
Cells C1:C10 = Gallons of Gas Used
Cell D1 = User Input Minimum Date
Cell D2 = User Input Maximum Date

I would like E1:E(whatever is appropriate according to conditions met) to list the appropriate data based on the dates listed in D1 and D2.

Tests:

If I use {=A1:A10} then it lists all dates.

If I use {=A1:A10>=D1} then it lists true for each date that meets that criteria and false for the rest.

If I use {=A1:A10>=D1;A1:A10<=D2} or {=(A1:A10>=D1;A1:a10<=D2)} then I get errors.

I've tried other formulas as well but each seems to either give errors or True/False.

Nothing I've tried seems to list the actual data. I'm hoping I'm not going to have to clutter up a sheet with Trues/Falses to then test those strings with a another formula.

I could, of course, write a simple enough macro to handle this but many people are uncomfortable with downloading apps with macros from unsigned sources and since I don't have a specific license or whatever, I meet that category. So it seems best to try to do everything through formulae.

Thanks for the assist.

EDIT:

Okay, I'm an idiot. The answer was obvious! lol {=if(A1:A10>=D1;if(A1:A10<=D2;A1:A10;"");"")}
OpenOffice 4.1.12 on Windows 10

If I had to, I'd put Tabasco on everything!
Post Reply