#1   Report Post  
Posted to microsoft.public.excel.misc
pdgood
 
Posts: n/a
Default Multiple ifs


I seem to struggle with multiple ifs. I'm creating a pricing sheet. If
the value of B22 (time spent on the job) is 0 (or blank) then the
answer (in D22) should be 0. If not, then the answer should be
whichever is greater: B22*80 (charge per hour) or 18.75. That much is
easy. But when overtime is considered then it gets more complex. I have
made C22 be the overtime cell and if an "x" is placed in that cell then
the answer needs to be multiplied by 1.5.
I was able to get all that working with:
=IF(B22="",0,IF(C22="x",B22*80*1.5,IF(C22<"x",MAX ((B22*80),18.75))))
The problem is, if someone places a 0 in B22 and there is no "x" then
I'm returning a charge of $18.75 but it should be 0.
So I tried to see if I could do a lookup (I admit I don't know what I'm
doing here) and ran this as a test
=IF(C22<"x",LOOKUP(B22,{0,0.001},{0,MAX((B22*80), 18.75)}))
But this returned an error.
I'm open to any way to accomplish this including ways I have not
tried.
Thanks.


--
pdgood
------------------------------------------------------------------------
pdgood's Profile: http://www.excelforum.com/member.php...o&userid=31623
View this thread: http://www.excelforum.com/showthread...hreadid=530502

  #2   Report Post  
Posted to microsoft.public.excel.misc
MattShoreson
 
Posts: n/a
Default Multiple ifs


=IF(OR(ISBLANK(B22),B22=0),0,IF(C22="x",B22*80*1.5 ,IF(C22<"x",MAX((B22*80),18.75))))


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=530502

  #3   Report Post  
Posted to microsoft.public.excel.misc
MattShoreson
 
Posts: n/a
Default Multiple ifs


=IF(OR(ISBLANK(B22),B22=0),0,IF(C22="x",B22*80*1.5 ,IF(C22<"x",MAX((B22*80),18.75))))


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=530502

  #4   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Multiple ifs

Try this..........

=IF(C22="x",B22*80*1.5,IF(B220,MAX((B22*80),18.75 ),""))

Vaya con Dios,
Chuck, CABGx3



"pdgood" wrote:


I seem to struggle with multiple ifs. I'm creating a pricing sheet. If
the value of B22 (time spent on the job) is 0 (or blank) then the
answer (in D22) should be 0. If not, then the answer should be
whichever is greater: B22*80 (charge per hour) or 18.75. That much is
easy. But when overtime is considered then it gets more complex. I have
made C22 be the overtime cell and if an "x" is placed in that cell then
the answer needs to be multiplied by 1.5.
I was able to get all that working with:
=IF(B22="",0,IF(C22="x",B22*80*1.5,IF(C22<"x",MAX ((B22*80),18.75))))
The problem is, if someone places a 0 in B22 and there is no "x" then
I'm returning a charge of $18.75 but it should be 0.
So I tried to see if I could do a lookup (I admit I don't know what I'm
doing here) and ran this as a test
=IF(C22<"x",LOOKUP(B22,{0,0.001},{0,MAX((B22*80), 18.75)}))
But this returned an error.
I'm open to any way to accomplish this including ways I have not
tried.
Thanks.


--
pdgood
------------------------------------------------------------------------
pdgood's Profile: http://www.excelforum.com/member.php...o&userid=31623
View this thread: http://www.excelforum.com/showthread...hreadid=530502


  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave O
 
Posts: n/a
Default Multiple ifs

Please try this one: if I interpreted your post and formula correctly,
this should do it for you.
=IF(B22=0,0,IF(C22="x",B22*80*1.5,MAX(B22*80,18.75 )))



  #6   Report Post  
Posted to microsoft.public.excel.misc
pdgood
 
Posts: n/a
Default Multiple ifs


Thanks! All three solutions work. The only difference is that the second
solution returns a blank if B22 is 0 and there is no "x" in C22. The
other two solutions return a 0. All of those will work for me. Many
thanks.


--
pdgood
------------------------------------------------------------------------
pdgood's Profile: http://www.excelforum.com/member.php...o&userid=31623
View this thread: http://www.excelforum.com/showthread...hreadid=530502

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
link multiple cells to multiple cells jpoltor Excel Discussion (Misc queries) 1 March 22nd 06 08:10 AM
AHHHH-Get Data from Multiple Excel workbooks JAA149 Excel Discussion (Misc queries) 5 October 30th 05 05:19 PM
view multiple files in multiple windows on multiple screens. tcom Excel Discussion (Misc queries) 7 September 15th 05 09:35 PM
How do i auto create multiple files from 1 with multiple sheets Kathy Excel Worksheet Functions 0 July 26th 05 01:23 AM
Can I get the mode, min, and max with multiple criteria? BobT Excel Discussion (Misc queries) 1 February 15th 05 03:20 AM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"