Excel Formula with Condition

NoviceKB

New Member
Joined
May 22, 2020
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hi Team,

I am in a bit of a fix with a formula I want to set up.

Goal is to calculate the total meal allowance (column E).

The intended formula is: Meal allowance rate (column B) * days in Germany (column C) * ((no of children)+1 if the number of days in Germany is more than zero).

I am struggling to capture the last bit of the formula (...*((no of children)+1 if the number of days in Germany is more than zero). The plus 1 only happens as long as the value in column C is more than zero.

Example is as shown in row 3 in my screenshot(Fred):

6.41* 16 * (0+1) = 384.6 (Here I added 1 because the value in C3 is more than zero.

Example in row 4 (Jane) is also seeing a +1 because even though the number of children is zero, the value in column C4 is more than zero.

Hope my explanation is clear enough.

Thanks in advance.

Regards,

Novice Kay
 

Attachments

  • Screenshot.PNG
    Screenshot.PNG
    17.1 KB · Views: 9

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Cross posted Help on defining an Excel formula based on a special condition

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Hi Yongle,

I just tried that in my first row and arrived at 384.6 instead of 576.9.

Where is the plus 1 in the formula?
OOPS - a typo :eek:

=B2*C2*(D2+(C2>0))

Book1
ABCDE
1NameAllowance per dayDaysChildren
2Jack6.41302576.9
3Fred6.41301384.6
4Jane6.41160102.56
Sheet4
Cell Formulas
RangeFormula
E2:E4E2=B2*C2*(D2+(C2>0))



Where is the plus 1 in the formula?
Try these formula
=1+(100=100) [ returns 2 ]
=1+("A"="B") [ returns 1 ]
TRUE equates to 1 and FALSE equates to zero

so this is where your 1 comes from
+(C2>0)
 
Upvote 0
OOPS - a typo :eek:

=B2*C2*(D2+(C2>0))

Book1
ABCDE
1NameAllowance per dayDaysChildren
2Jack6.41302576.9
3Fred6.41301384.6
4Jane6.41160102.56
Sheet4
Cell Formulas
RangeFormula
E2:E4E2=B2*C2*(D2+(C2>0))



Where is the plus 1 in the formula?
Try these formula
=1+(100=100) [ returns 2 ]
=1+("A"="B") [ returns 1 ]
TRUE equates to 1 and FALSE equates to zero

so this is where your 1 comes from
+(C2>0)
Many many thanks!! Really appreciate the detailed explanation! THANKS!
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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