[Solved] Combining 2 IF(AND) tests

Discuss the spreadsheet application
Post Reply
michaelz7
Posts: 3
Joined: Fri Nov 08, 2019 5:14 am

[Solved] Combining 2 IF(AND) tests

Post by michaelz7 »

hello,

I have read what I could find online and in other answers in this fine forum but need to ask for help.

I would like to combine the following 2 IF(and) tests looking for return of TRUE if either is true.

=IF(AND(J9=1);(F9+G9+H9>45000))

=IF(AND(J9=2);(F9+G9+H9>30000))

I've read some answers on this site from very talented and experienced folks. I hope my goal is doable. Have tried many iterations but without success.
Thank You.
michael

:crazy:
Last edited by robleyd on Fri Nov 08, 2019 6:11 am, edited 1 time in total.
Reason: Tagged [Solved]
Apache OpenOffice 4.1.7 Mac OS 10.11.6
User avatar
robleyd
Moderator
Posts: 5500
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Combining 2 IF(AND) tests

Post by robleyd »

Seems like you need an OR to select if either AND is TRUE; maybe something like

Code: Select all

=IF( OR ( AND ( J9=1 ; F9+G9+H9>45000 ) ; AND ( J9=2 ; F9+G9+H9>30000 ) ) ; 1; 0)
Substitute whatever you need for 1 - TRUE and 0 - FALSE
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.2.2; SlackBuild for 26.2.2 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
michaelz7
Posts: 3
Joined: Fri Nov 08, 2019 5:14 am

Re: Combining 2 IF(AND) tests

Post by michaelz7 »

That works perfectly David. Thank you very much.

I love OpenOffice. Thank you Apache. So glad to not use Gatesware.

Again, David I appreciate the very quick reply to my question, and elegant solution of yours.

Good night, from frosty Oshkosh, WI USA.

:bravo:
Apache OpenOffice 4.1.7 Mac OS 10.11.6
User avatar
MrProgrammer
Moderator
Posts: 5424
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Combining 2 IF(AND) tests

Post by MrProgrammer »

Hi, and welcome to the forum.
michaelz7 wrote:I would like to combine the following 2 IF(and) tests looking for return of TRUE if either is true.
=IF(AND(J9=1);(F9+G9+H9>45000))
=IF(AND(J9=2);(F9+G9+H9>30000))
=SUMPRODUCT(J9={1|2};F9+G9+H9>{45000|30000})

[Tutorial] The SUMPRODUCT function

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
michaelz7
Posts: 3
Joined: Fri Nov 08, 2019 5:14 am

Re: [Solved] Combining 2 IF(AND) tests

Post by michaelz7 »

I do enjoy the power of spreadsheets. It has been a several years since I tried anything to tap into the power, and much of the learning curve I'd climbed has faded without frequent use.

I see you're enjoying your workhorse as I am. My computer experience began in Chicago with Chicago MUG (TROU) in mid 1980s.

Thank you Dr. Programmer. Always interesting to see that there is more than one successful way to navigate thru the maze. :)

I'll try tomorrow. I am excited to learn. My spreadsheet use is for volunteer work. I enjoy being a blessing where I can, and I appreciate those who do the same.


g'nite Dr. P

:super:
Apache OpenOffice 4.1.7 Mac OS 10.11.6
Post Reply