Nested IF

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have 2 conditions in two cells and I need these conditions to be combined in one cell, below are the conditions:

=IF($X$5="Global",SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$E$2:$E$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2,SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$D$2:$D$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2)

=SUMIFS(Galaxy_Data!$T$473:$T$942,Galaxy_Data!$B$473:$B$942,'It would take'!$V$9,Galaxy_Data!$D$473:$D$942,'It would take'!$X$5)/2

Can you please help?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
=IF($X$5="Global",

SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$E$2:$E$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2,
SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$D$2:$D$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2)

you have a true and a false for X5

when do you want to use
=SUMIFS(Galaxy_Data!$T$473:$T$942,Galaxy_Data!$B$473:$B$942,'It would take'!$V$9,Galaxy_Data!$D$473:$D$942,'It would take'!$X$5)/2
 
Upvote 0
thank you for your help.
Basically, these 2 conditions are together, if first condition will not meet, then the other condition will be the answer, it's either/or
 
Upvote 0
but you have 3 formulas

when X5 = "global"
you have
SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$E$2:$E$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2,

when X5 does NOT =
"global"
you have
SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$D$2:$D$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2)

so thats the either/OR already covered

and then a third formula - BUT there no condition left for X5

=SUMIFS(Galaxy_Data!$T$473:$T$942,Galaxy_Data!$B$473:$B$942,'It would take'!$V$9,Galaxy_Data!$D$473:$D$942,'It would take'!$X$5)/2
 
Upvote 0
Let me be more clear:

What I need is if condition 1 won't be met, then go to condition 2, if both won't meet then condition 3. Does that make sense?
 
Upvote 0
yes , But you have not given me three conditions
Condition 1 = X5 = "global"
Condition 2 =
X5 Does not equal "global"
so there is no 3rd condition

What I need is if condition 1 (X5 = global) won't be met, then go to condition 2, (X5 does not = global) if both won't meet (no such thing, it either is global or NOT ) then condition 3. Does that make sense?

 
Upvote 0
You're right, so let me rephrase what I need:

I have 2 conditions, If X5= represent (Country), then =SUMIFS(Galaxy_Data!$T$473:$T$942,Galaxy_Data!$B$473:$B$942,'It would take'!$V$9,Galaxy_Data!$D$473:$D$942,'It would take'!$X$5)/2

and If X5= represent (Region), then = =IF($X$5="Global",SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$E$2:$E$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2,SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$D$2:$D$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2)
 
Upvote 0
so what does
X5= represent (Country)
X5= represent (Region)
Mean
What would be the contents of the cell X5 to meet the condition represent (Country)
AND
What would be the contents of the cell X5 to meet the condition represent (Region)

You would use a Nested IF

=IF ( X5 = represent (Country) ,
SUMIFS(Galaxy_Data!$T$473:$T$942,Galaxy_Data!$B$473:$B$942,'It would take'!$V$9,Galaxy_Data!$D$473:$D$942,'It would take'!$X$5)/2 ,
IF ( X5= represent (Region) ,
SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$E$2:$E$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2 ,
SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$D$2:$D$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2))

so the above then meets your three conditions required
IF ( Condition 1
represent (Country) MET
SUMIFS(Galaxy_Data!$T$473:$T$942,Galaxy_Data!$B$473:$B$942,'It would take'!$V$9,Galaxy_Data!$D$473:$D$942,'It would take'!$X$5)/2 ,
IF ( Condition 2 represent (Region) MET
SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$E$2:$E$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2 ,
neither met
SUMIFS(Galaxy_Data!$T$2:$T$471,Galaxy_Data!$D$2:$D$471,'It would take'!$X$5,Galaxy_Data!$B$2:$B$471,'It would take'!$V$9)/2))
 
Last edited:
Upvote 0
Thank you so much for your time and valued help Etaf!
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,617
Latest member
Narendra Babu D

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