INDEX and IF formula

Jagat Pavasia

Active Member
Joined
Mar 9, 2015
Messages
359
Office Version
  1. 2021
Platform
  1. Windows
DEAR SIR,

I have a sheet contain some data in D5:F12
d5:d12 have value
e5:e12
have category
f5:f12
have sub-category

and then i want that
if i type "COST" in E18 then answer should be in from E19 to E31
if i type both in E18="cost" and F18="A" then answer should be also in from E19 to E31
if i blank both E18 and F18 then nothing to do and blank

for more explain i have attached 3 photos,

please give me formula that can i enter into E19 to E31
i am a new in excel
1.JPG
2.JPG
3.JPG
 
Last edited:

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I think we're going to need a bit more information to work with.
 
Upvote 0
I think we're going to need a bit more information to work with.

please download my 3 photos and then please give me solution







New Microsoft Excel Worksheet.xlsx
ABCDEFGH
1
2
3
4ValueCategorySub-Catgory
510COSTA
620COSTA
730COSTA
840COSTA
950COSTB
1060COSTB
1170COSTB
1280COSTB
13
14
15
16
17Enter your Categorycategorysub-category
18costA
1910
2020
2130
2240
23
24
25
26
27
28
29
30
31
32
33
Sheet1
 
Upvote 0
This will work

Excel Formula:
=FILTER(D5:D12,((E5:E12=E18)+IF(F18<>"",F5:F12=F18))>0,"")
 
Upvote 0
This will work

Excel Formula:
=FILTER(D5:D12,((E5:E12=E18)+IF(F18<>"",F5:F12=F18))>0,"")
THIS WILL WORK,
BUT,
if i type only "cost" in E18 then all entry should be displayed contain "cost"
and then
when i type "cost" in E18, "A" in F18 then only show that both cost and A match entry
 
Upvote 0
I misread the question while I was scrolling up and down
Excel Formula:
=FILTER(D5:D12,(E5:E12=E18)*IF(F18<>"",F5:F12=F18,1),"")
 
Upvote 0
@Jagat Pavasia if the Filter function works for you then you are not using 2019, so I would recommend updating your profile to show what you are using.
 
Upvote 0
ok sir i will update my profile soon,

but one more question that if my both E18 and F18 empty then raw has "0".
can i remove it ?
1.JPG
 
Upvote 0
Try this one.
Excel Formula:
=FILTER(D5:D15,IF(E18<>"",E5:E15=E18)*IF(F18<>"",F5:F15=F18,1),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,215,338
Messages
6,124,354
Members
449,155
Latest member
ravioli44

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