Multiple Ifs with Calculations

melbwarrior

New Member
Joined
Apr 19, 2018
Messages
16
Hi All

Please assist on the below, I am struggling to create a Nested IF statement


Sample Data:

[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl66, width: 64"]A[/TD]
[TD="class: xl66, width: 64"]B[/TD]
[TD="class: xl66, width: 64"]C[/TD]
[/TR]
[TR]
[TD="class: xl67"]aa[/TD]
[TD="class: xl67"]ff[/TD]
[TD="class: xl69"]1[/TD]
[/TR]
[TR]
[TD="class: xl67"]bb[/TD]
[TD="class: xl67"]gg[/TD]
[TD="class: xl69"]1[/TD]
[/TR]
[TR]
[TD="class: xl67"]bb[/TD]
[TD="class: xl67"]gg[/TD]
[TD="class: xl69"]5[/TD]
[/TR]
[TR]
[TD="class: xl68"]cc[/TD]
[TD="class: xl68"]hh[/TD]
[TD="class: xl69"]4[/TD]
[/TR]
[TR]
[TD="class: xl67"]aa[/TD]
[TD="class: xl68"]hh[/TD]
[TD="class: xl69"]5[/TD]
[/TR]
[TR]
[TD="class: xl68"]cc[/TD]
[TD="class: xl67"]gg[/TD]
[TD="class: xl69"]6[/TD]
[/TR]
[TR]
[TD="class: xl67"]bb[/TD]
[TD="class: xl67"]ff[/TD]
[TD="class: xl69"]5[/TD]
[/TR]
[TR]
[TD="class: xl68"]cc[/TD]
[TD="class: xl67"]ff[/TD]
[TD="class: xl69"]4[/TD]
[/TR]
</tbody>[/TABLE]


What I am looking for is:

If Column A = CC then multiple the number in column C by 2
If Column B = GG then multiple the number in column C by 3
Any other value in column B multiple the column C by 4

Apologies if this is hard to understand

thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hint for next time: When you give sample data, also giving the expected results usually helps clarify your requirements.

Is this what you want?

Excel Workbook
ABCD
1
2aaff14
3bbgg13
4bbgg515
5cchh48
6aahh520
7ccgg612
8bbff520
9ccff48
IF
 
Last edited:
Upvote 0
Hi

Sorry for the delay in getting back to you.

That looks good - I have one more question if that is ok.


[TABLE="class: cms_table, width: 192"]
<tbody>[TR]
[TD="class: cms_table_xl66, width: 64"]A[/TD]
[TD="class: cms_table_xl66, width: 64"]B[/TD]
[TD="class: cms_table_xl66, width: 64"]C[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl67"]aa[/TD]
[TD="class: cms_table_xl67"]ff[/TD]
[TD="class: cms_table_xl69"]1[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl67"]bb[/TD]
[TD="class: cms_table_xl67"]gg1[/TD]
[TD="class: cms_table_xl69"]1[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl67"]bb[/TD]
[TD="class: cms_table_xl67"]gg23[/TD]
[TD="class: cms_table_xl69"]5[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl68"]cc[/TD]
[TD="class: cms_table_xl68"]hh[/TD]
[TD="class: cms_table_xl69"]4[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl67"]aa[/TD]
[TD="class: cms_table_xl68"]hh[/TD]
[TD="class: cms_table_xl69"]5[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl68"]cc[/TD]
[TD="class: cms_table_xl67"]gg32[/TD]
[TD="class: cms_table_xl69"]6[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl67"]bb[/TD]
[TD="class: cms_table_xl67"]ff[/TD]
[TD="class: cms_table_xl69"]5[/TD]
[/TR]
[TR]
[TD="class: cms_table_xl68"]cc[/TD]
[TD="class: cms_table_xl67"]ff[/TD]
[TD="class: cms_table_xl69"]4[/TD]
[/TR]
</tbody>[/TABLE]

Could the formula be modified to make the same calculation in Column B for GG, if there a few difference occurences - as per above. (gg1, gg3,gg32). The calculation would still be the same as the previous formula

I can't figure out how to introduce the Find left function into the formula

again thanks for your help
 
Upvote 0
Try
=C2*IF(A2="cc",2,IF(LEFT(B2,2)="gg",3,4))
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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